Examples of orQualifier()


Examples of org.apache.cayenne.query.PrefetchSelectQuery.orQualifier()

                    else {
                        allJoinsQualifier = allJoinsQualifier.andExp(joinQualifier);
                    }
                }

                currentQuery.orQualifier(allJoinsQualifier);
                qualifiersCount += joins.size();
            }

            PrefetchTreeNode jointSubtree = node.cloneJointSubtree();
View Full Code Here

Examples of org.apache.cayenne.query.SelectQuery.orQualifier()

    public void testMultiObjRelFetch() throws Exception {
        createArtistsAndPaintingsDataSet();

        SelectQuery q = new SelectQuery(Painting.class);
        q.andQualifier(ExpressionFactory.matchExp("toArtist.artistName", "artist2"));
        q.orQualifier(ExpressionFactory.matchExp("toArtist.artistName", "artist4"));
        List<Painting> results = context.performQuery(q);

        assertEquals(2, results.size());
    }
View Full Code Here

Examples of org.apache.cayenne.query.SelectQuery.orQualifier()

    public void testMultiDbRelFetch() throws Exception {
        createArtistsAndPaintingsDataSet();

        SelectQuery q = new SelectQuery("Painting");
        q.andQualifier(ExpressionFactory.matchDbExp("toArtist.ARTIST_NAME", "artist2"));
        q.orQualifier(ExpressionFactory.matchDbExp("toArtist.ARTIST_NAME", "artist4"));
        List<?> results = context.performQuery(q);

        assertEquals(2, results.size());
    }
View Full Code Here

Examples of org.apache.cayenne.query.SelectQuery.orQualifier()

        SelectQuery mixedConditionQuery = new SelectQuery(Artist.class);
        mixedConditionQuery.andQualifier(ExpressionFactory.matchExp(
                Artist.PAINTING_ARRAY_PROPERTY + Entity.OUTER_JOIN_INDICATOR,
                null));
        mixedConditionQuery.orQualifier(ExpressionFactory.matchExp(
                Artist.ARTIST_NAME_PROPERTY,
                "AA1"));
        mixedConditionQuery.addOrdering(Artist.ARTIST_NAME_PROPERTY, SortOrder.ASCENDING);

        artists = context.performQuery(mixedConditionQuery);
View Full Code Here

Examples of org.apache.cayenne.query.SelectQuery.orQualifier()

        SelectQuery mixedConditionQuery = new SelectQuery(Artist.class);
        mixedConditionQuery.andQualifier(ExpressionFactory.matchExp(
                Artist.PAINTING_ARRAY_PROPERTY + Entity.OUTER_JOIN_INDICATOR,
                null));
        mixedConditionQuery.orQualifier(ExpressionFactory.matchExp(
                Artist.ARTIST_NAME_PROPERTY,
                "AA1"));
        mixedConditionQuery.addOrdering(Artist.ARTIST_NAME_PROPERTY, SortOrder.ASCENDING);

        artists = context.performQuery(mixedConditionQuery);
View Full Code Here

Examples of org.apache.cayenne.query.SelectQuery.orQualifier()

                "paintingArray+.paintingTitle",
                "AB%"));
        query.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY).setSemantics(
                PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);

        query.orQualifier(ExpressionFactory.likeExp("artistName", "A%"));
        query.addOrdering(Artist.ARTIST_NAME_PROPERTY, SortOrder.ASCENDING);

        List<Artist> result = createDataContext().performQuery(query);
        assertEquals(2, result.size());
View Full Code Here

Examples of org.apache.cayenne.query.SelectQuery.orQualifier()

    public void testMultiColumnRelationship() throws Exception {
        createBagWithTwoBoxesAndPlentyOfBallsDataSet();

        SelectQuery query = new SelectQuery(Ball.class);
        query.orQualifier(matchExp(Ball.THING_VOLUME_PROPERTY, 40).andExp(matchExp(Ball.THING_WEIGHT_PROPERTY, 30)));
        query.orQualifier(matchExp(Ball.THING_VOLUME_PROPERTY, 20).andExp(matchExp(Ball.THING_WEIGHT_PROPERTY, 10)));

        query.addPrefetch(Ball.THING_PROPERTY).setSemantics(PrefetchTreeNode.DISJOINT_BY_ID_PREFETCH_SEMANTICS);

        final List<Ball> balls = context.performQuery(query);
View Full Code Here

Examples of org.apache.cayenne.query.SelectQuery.orQualifier()

    public void testMultiColumnRelationship() throws Exception {
        createBagWithTwoBoxesAndPlentyOfBallsDataSet();

        SelectQuery query = new SelectQuery(Ball.class);
        query.orQualifier(matchExp(Ball.THING_VOLUME_PROPERTY, 40).andExp(matchExp(Ball.THING_WEIGHT_PROPERTY, 30)));
        query.orQualifier(matchExp(Ball.THING_VOLUME_PROPERTY, 20).andExp(matchExp(Ball.THING_WEIGHT_PROPERTY, 10)));

        query.addPrefetch(Ball.THING_PROPERTY).setSemantics(PrefetchTreeNode.DISJOINT_BY_ID_PREFETCH_SEMANTICS);

        final List<Ball> balls = context.performQuery(query);
View Full Code Here

Examples of org.apache.cayenne.query.SelectQuery.orQualifier()

            ObjectId id = coder.toObjectId(uuid);
            Expression idExp = ExpressionFactory.matchAllDbExp(
                    id.getIdSnapshot(),
                    Expression.EQUAL_TO);
            query.orQualifier(idExp);
        }

        int capacity = (int) Math.ceil(sources.size() / 0.75d);
        Map<String, Object> results = new HashMap<String, Object>(capacity);
View Full Code Here

Examples of org.apache.cayenne.query.SelectQuery.orQualifier()

    public void testMultiObjRelFetch() throws Exception {
        createArtistsAndPaintingsDataSet();

        SelectQuery q = new SelectQuery(Painting.class);
        q.andQualifier(ExpressionFactory.matchExp("toArtist.artistName", "artist2"));
        q.orQualifier(ExpressionFactory.matchExp("toArtist.artistName", "artist4"));
        List<Painting> results = context.performQuery(q);

        assertEquals(2, results.size());
    }
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.