Examples of ASTPath


Examples of org.apache.cayenne.exp.parser.ASTPath

        }

        String prefix;
        if (jointRoot != this) {
            Expression objectPath = Expression.fromString(getPath(jointRoot));
            ASTPath translated = (ASTPath) ((PrefetchProcessorNode) jointRoot)
                    .getResolver()
                    .getEntity()
                    .translateToDbPath(objectPath);

            // make sure we do not include "db:" prefix
            prefix = translated.getOperand(0) + ".";
        }
        else {
            prefix = "";
        }
View Full Code Here

Examples of org.apache.cayenne.exp.parser.ASTPath

        }

        String prefix;
        if (jointRoot != this) {
            Expression objectPath = Expression.fromString(getPath(jointRoot));
            ASTPath translated = (ASTPath) ((PrefetchProcessorNode) jointRoot)
                    .getResolver()
                    .getEntity()
                    .translateToDbPath(objectPath);

            // make sure we do not include "db:" prefix
            prefix = translated.getOperand(0) + ".";
        }
        else {
            prefix = "";
        }
View Full Code Here

Examples of org.apache.cayenne.exp.parser.ASTPath

        }

        String prefix;
        if (jointRoot != this) {
            Expression objectPath = Expression.fromString(getPath(jointRoot));
            ASTPath translated = (ASTPath) ((PrefetchProcessorNode) jointRoot)
                    .getResolver()
                    .getEntity()
                    .translateToDbPath(objectPath);

            // make sure we do not include "db:" prefix
            prefix = translated.getOperand(0) + ".";
        }
        else {
            prefix = "";
        }
View Full Code Here

Examples of org.apache.cayenne.exp.parser.ASTPath

                String alias = aliasBase + i;
                String aliasedPath = beforeSplit + alias + afterSplit;
                i++;

                ASTPath pathExp = new ASTObjPath(aliasedPath);
                pathExp.setPathAliases(Collections.singletonMap(alias, splitChunk));
                matches.add(new ASTEqual(pathExp, value));
            }
        }
        else {
            for (Object value : values) {
View Full Code Here

Examples of org.apache.cayenne.exp.parser.ASTPath

                String alias = aliasBase + i;
                String aliasedPath = beforeSplit + alias + afterSplit;
                i++;

                ASTPath pathExp = new ASTObjPath(aliasedPath);
                pathExp.setPathAliases(Collections.singletonMap(alias, splitChunk));
                matches.add(new ASTEqual(pathExp, value));
            }
        }
        else {
            for (Object value : values) {
View Full Code Here

Examples of org.apache.cayenne.exp.parser.ASTPath

        }

        final String prefix;
        if (jointRoot != this) {
            Expression objectPath = Expression.fromString(getPath(jointRoot));
            ASTPath translated = (ASTPath) ((PrefetchProcessorNode) jointRoot)
                    .getResolver()
                    .getEntity()
                    .translateToDbPath(objectPath);

            // make sure we do not include "db:" prefix
            prefix = translated.getOperand(0) + ".";
        }
        else {
            prefix = "";
        }
View Full Code Here

Examples of org.apache.cayenne.exp.parser.ASTPath

                String alias = aliasBase + i;
                String aliasedPath = beforeSplit + alias + afterSplit;
                i++;

                ASTPath pathExp = new ASTObjPath(aliasedPath);
                pathExp.setPathAliases(Collections.singletonMap(alias, splitChunk));
                matches.add(new ASTEqual(pathExp, value));
            }
        }
        else {
            for (Object value : values) {
View Full Code Here

Examples of org.jboss.as.cmp.ejbql.ASTPath

        }

        // add all the additional path tables
        if (!allJoinPaths.isEmpty()) {
            for (Iterator iter = allJoinPaths.iterator(); iter.hasNext(); ) {
                ASTPath path = (ASTPath) iter.next();
                for (int i = 0; i < path.size(); i++) {
                    declareTables(path, i, buf);
                }
            }
        }

        // add all parent paths for collection member join paths
        if (!allCollectionMemberJoinPaths.isEmpty()) {
            for (Iterator iter = allCollectionMemberJoinPaths.values().iterator(); iter.hasNext(); ) {
                ASTPath path = (ASTPath) iter.next();
                // don't declare the last one as the first path was left joined
                for (int i = 0; i < path.size() - 1; i++) {
                    declareTables(path, i, buf);
                }
            }
        }

        // get all the left joined paths
        if (!allLeftJoinPaths.isEmpty()) {
            Set allLeftJoins = new HashSet();
            for (Iterator iter = allLeftJoinPaths.values().iterator(); iter.hasNext(); ) {
                allLeftJoins.addAll((Set) iter.next());
            }

            // add all parent paths for left joins
            for (Iterator iter = allLeftJoins.iterator(); iter.hasNext(); ) {
                ASTPath path = (ASTPath) iter.next();
                // don't declare the last one as the first path was left joined
                for (int i = 0; i < path.size() - 1; i++) {
                    declareTables(path, i, buf);
                }
            }
        }
View Full Code Here

Examples of org.jboss.as.cmp.ejbql.ASTPath

        if (subquerySupported || paths == null) {
            return;
        }

        for (Iterator iter = paths.iterator(); iter.hasNext(); ) {
            ASTPath path = (ASTPath) iter.next();

            JDBCCMRFieldBridge cmrField = (JDBCCMRFieldBridge) path.getCMRField();
            String parentAlias = aliasManager.getAlias(parentPath);

            if (cmrField.getRelationMetaData().isForeignKeyMappingStyle()) {
                JDBCEntityBridge childEntity = (JDBCEntityBridge) cmrField.getRelatedEntity();
                String childAlias = aliasManager.getAlias(path.getPath());

                buf.append(SQLUtil.LEFT_JOIN)
                        .append(childEntity.getQualifiedTableName())
                        .append(' ')
                        .append(childAlias)
                        .append(SQLUtil.ON);
                SQLUtil.getJoinClause(cmrField, parentAlias, childAlias, buf);
            } else {
                String relationTableAlias = aliasManager.getRelationTableAlias(path.getPath());
                buf.append(SQLUtil.LEFT_JOIN)
                        .append(cmrField.getQualifiedTableName())
                        .append(' ')
                        .append(relationTableAlias)
                        .append(SQLUtil.ON);
View Full Code Here

Examples of org.jboss.as.cmp.ejbql.ASTPath

    private void createThetaJoin(StringBuffer buf) {
        Set joinedAliases = new HashSet();
        // add all the additional path tables
        if (!ctermJoinPaths.isEmpty()) {
            for (Iterator iter = ctermJoinPaths.iterator(); iter.hasNext(); ) {
                ASTPath path = (ASTPath) iter.next();
                for (int i = 0; i < path.size(); i++) {
                    createThetaJoin(path, i, joinedAliases, buf);
                }
            }
        }

        // add all the collection member path tables
        if (!ctermCollectionMemberJoinPaths.isEmpty()) {
            for (Iterator iter = ctermCollectionMemberJoinPaths.entrySet().iterator(); iter.hasNext(); ) {
                Map.Entry entry = (Map.Entry) iter.next();
                String childAlias = (String) entry.getKey();
                ASTPath path = (ASTPath) entry.getValue();

                // join the member path
                createThetaJoin(path, path.size() - 1, joinedAliases, childAlias, buf);

                // join the member path parents
                for (int i = 0; i < path.size() - 1; i++) {
                    createThetaJoin(path, i, joinedAliases, buf);
                }
            }
        }

        // get all the left joined paths
        if (!ctermLeftJoinPaths.isEmpty()) {
            Set allLeftJoins = new HashSet();
            for (Iterator iter = ctermLeftJoinPaths.values().iterator(); iter.hasNext(); ) {
                allLeftJoins.addAll((Set) iter.next());
            }

            // add all parent paths for left joins
            for (Iterator iter = allLeftJoins.iterator(); iter.hasNext(); ) {
                ASTPath path = (ASTPath) iter.next();
                // don't declare the last one as the first path was left joined
                for (int i = 0; i < path.size() - 1; i++) {
                    createThetaJoin(path, i, joinedAliases, buf);
                }
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.