Package org.apache.cayenne.exp.parser

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


                        aliases);
        assertTrue(lastRelationship.getRelationship() != null);
        assertEquals("toGallery", lastRelationship.getRelationship().getName());

        PathComponent<ObjAttribute, ObjRelationship> lastLeftJoinRelationship = artistE
                .lastPathComponent(new ASTObjPath("paintingArray+.toGallery+"), aliases);
        assertTrue(lastLeftJoinRelationship.getRelationship() != null);
        assertEquals("toGallery", lastLeftJoinRelationship.getRelationship().getName());

        PathComponent<ObjAttribute, ObjRelationship> lastAliasedRelationship = artistE
                .lastPathComponent(new ASTObjPath("a"), aliases);
        assertTrue(lastAliasedRelationship.getRelationship() != null);
        assertEquals("toGallery", lastAliasedRelationship.getRelationship().getName());
    }
View Full Code Here


        List<Expression> pairs = new ArrayList<Expression>(map.size());

        for (Map.Entry<String, ?> entry : map.entrySet()) {

            Expression exp = expressionOfType(pairType);
            exp.setOperand(0, new ASTObjPath(entry.getKey()));
            exp.setOperand(1, wrapPathOperand(entry.getValue()));
            pairs.add(exp);
        }

        return joinExp(Expression.OR, pairs);
View Full Code Here

                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) {
                matches.add(new ASTEqual(new ASTObjPath(path), value));
            }
        }

        return joinExp(Expression.AND, matches);
    }
View Full Code Here

        List<Expression> pairs = new ArrayList<Expression>(map.size());

        for (Map.Entry<String, ?> entry : map.entrySet()) {

            Expression exp = expressionOfType(pairType);
            exp.setOperand(0, new ASTObjPath(entry.getKey()));
            exp.setOperand(1, wrapPathOperand(entry.getValue()));
            pairs.add(exp);
        }

        return joinExp(Expression.AND, pairs);
View Full Code Here

    /**
     * A convenience method to create an OBJ_PATH "equal to" expression.
     */
    public static Expression matchExp(String pathSpec, Object value) {
        return new ASTEqual(new ASTObjPath(pathSpec), value);
    }
View Full Code Here

    /**
     * A convenience method to create an OBJ_PATH "not equal to" expression.
     */
    public static Expression noMatchExp(String pathSpec, Object value) {
        return new ASTNotEqual(new ASTObjPath(pathSpec), value);
    }
View Full Code Here

    /**
     * A convenience method to create an OBJ_PATH "less than" expression.
     */
    public static Expression lessExp(String pathSpec, Object value) {
        return new ASTLess(new ASTObjPath(pathSpec), value);
    }
View Full Code Here

    /**
     * A convenience method to create an OBJ_PATH "less than or equal to" expression.
     */
    public static Expression lessOrEqualExp(String pathSpec, Object value) {
        return new ASTLessOrEqual(new ASTObjPath(pathSpec), value);
    }
View Full Code Here

    /**
     * A convenience method to create an OBJ_PATH "greater than" expression.
     */
    public static Expression greaterExp(String pathSpec, Object value) {
        return new ASTGreater(new ASTObjPath(pathSpec), value);
    }
View Full Code Here

    /**
     * A convenience method to create an OBJ_PATH "greater than or equal to" expression.
     */
    public static Expression greaterOrEqualExp(String pathSpec, Object value) {
        return new ASTGreaterOrEqual(new ASTObjPath(pathSpec), value);
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.exp.parser.ASTObjPath

Copyright © 2018 www.massapicom. 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.