Examples of andQualifier()


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

    }

    @SuppressWarnings("unchecked")
    public Customer findCustomerByName(String name) {
        SelectQuery query = new SelectQuery(Customer.class);
        query.andQualifier(ExpressionFactory.matchExp(Customer.NAME_PROPERTY,name));

        List list = performQuery(query);

        if (!list.isEmpty()) {
            return (Customer) list.get(0);
View Full Code Here

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

        artistGroupHelper.insert(1, 33001);
        artistGroupHelper.insert(1, 33002);
        artistGroupHelper.insert(1, 33004);

        SelectQuery missingToManyQuery = new SelectQuery(Artist.class);
        missingToManyQuery.andQualifier(ExpressionFactory.matchExp(
                Artist.GROUP_ARRAY_PROPERTY + Entity.OUTER_JOIN_INDICATOR,
                null));
        missingToManyQuery.addOrdering(Artist.ARTIST_NAME_PROPERTY, SortOrder.ASCENDING);

        List<Artist> artists = context.performQuery(missingToManyQuery);
View Full Code Here

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

        paintingHelper.insert(33001, 33001, "P1");
        paintingHelper.insert(33002, 33002, "P2");

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

        List<Artist> artists = context.performQuery(missingToManyQuery);
View Full Code Here

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

        List<Artist> artists = context.performQuery(missingToManyQuery);
        assertEquals(2, artists.size());
        assertEquals("BB1", artists.get(0).getArtistName());

        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"));
View Full Code Here

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

        paintingHelper.insert(33001, 33001, "P1");
        paintingHelper.insert(33002, 33002, "P2");

        SelectQuery missingToManyQuery = new SelectQuery(Artist.class);
        missingToManyQuery.andQualifier(Expression.fromString("paintingArray+ = null"));
        missingToManyQuery.addOrdering(Artist.ARTIST_NAME_PROPERTY, SortOrder.ASCENDING);

        List<Artist> artists = context.performQuery(missingToManyQuery);
        assertEquals(2, artists.size());
        assertEquals("BB1", artists.get(0).getArtistName());
View Full Code Here

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

        List<Artist> artists = context.performQuery(missingToManyQuery);
        assertEquals(2, artists.size());
        assertEquals("BB1", artists.get(0).getArtistName());

        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"));
View Full Code Here

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

                @Override
                protected void assertResult() throws Exception {
                    query.setQualifier(ExpressionFactory.matchExp("name", test.getName()));
                    assertEquals(1, context.performQuery(query).size());
                   
                    query.andQualifier(ExpressionFactory.matchDbExp("DELETED", true));
                    assertEquals(0, context.performQuery(query).size());
                }
            }.assertWithTimeout(200);
           
            context.deleteObject(test);
View Full Code Here

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

    public void testPrefetch_ToOne_DbPath() throws Exception {
        createTwoArtistsAndTwoPaintingsDataSet();

        SelectQuery q = new SelectQuery(Painting.class);
        q.addPrefetch(Painting.TO_ARTIST_PROPERTY);
        q.andQualifier(ExpressionFactory.matchDbExp("toArtist.ARTIST_NAME", "artist2"));

        List<Painting> results = context.performQuery(q);

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

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

    public void testPrefetch_ToOne_ObjPath() throws Exception {
        createTwoArtistsAndTwoPaintingsDataSet();

        SelectQuery q = new SelectQuery(Painting.class);
        q.addPrefetch(Painting.TO_ARTIST_PROPERTY);
        q.andQualifier(ExpressionFactory.matchExp("toArtist.artistName", "artist2"));

        List<Painting> results = context.performQuery(q);
        assertEquals(1, results.size());
    }
View Full Code Here

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

                Artist.class,
                "INSERT INTO PAINTING (PAINTING_ID, ARTIST_ID, PAINTING_TITLE)"
                        + " VALUES (2, 2, 'Y')"));

        SelectQuery query = new SelectQuery(Artist.class);
        query.andQualifier(ExpressionFactory.matchExp("p.paintingTitle", "X"));

        query.aliasPathSplits("paintingArray", "p");

        List<Artist> artists = context.performQuery(query);
        assertEquals(1, artists.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.