Examples of performQuery()


Examples of org.apache.cayenne.ObjectContext.performQuery()

        query.andQualifier(ExpressionFactory.matchExp("p1.paintingTitle", "X"));
        query.andQualifier(ExpressionFactory.matchExp("p2.paintingTitle", "Y"));

        query.aliasPathSplits("paintingArray", "p1", "p2");

        List<Artist> artists = context.performQuery(query);
        assertEquals(1, artists.size());
        assertEquals("BB", artists.get(0).getArtistName());
    }
}
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.performQuery()

        ObjectContext childContext = context.createChildContext();

        // make sure we fetch in predictable order
        SelectQuery query = new SelectQuery(Artist.class);
        query.addOrdering(Artist.ARTIST_NAME_PROPERTY, SortOrder.ASCENDING);
        List objects = childContext.performQuery(query);

        assertEquals(4, objects.size());

        Artist childNew = childContext.newObject(Artist.class);
        childNew.setArtistName("NNN");
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.performQuery()

        ObjectContext childContext = context.createChildContext();

        // make sure we fetch in predictable order
        SelectQuery query = new SelectQuery(Artist.class);
        query.addOrdering(Artist.ARTIST_NAME_PROPERTY, SortOrder.ASCENDING);
        List objects = childContext.performQuery(query);

        assertEquals(4, objects.size());

        // delete AND modify
        Artist childDeleted = (Artist) objects.get(2);
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.performQuery()

        ObjectContext childContext = context.createChildContext();

        // make sure we fetch in predictable order
        SelectQuery query = new SelectQuery(Artist.class);
        query.addOrdering(Artist.ARTIST_NAME_PROPERTY, SortOrder.ASCENDING);
        List objects = childContext.performQuery(query);

        assertEquals(4, objects.size());

        Artist childNew = childContext.newObject(Artist.class);
        childNew.setArtistName("NNN");
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.performQuery()

                        }
                }
            };
   
            test.test(q);
            context.performQuery(q);           
           
            //testing outer join!!
            q = new SelectQuery(Painting.class);
            q.addOrdering("toArtist+.artistName", SortOrder.ASCENDING);
            test.test(q);
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.performQuery()

           
            //testing outer join!!
            q = new SelectQuery(Painting.class);
            q.addOrdering("toArtist+.artistName", SortOrder.ASCENDING);
            test.test(q);
            context.performQuery(q);
           
            //testing quering from related table
            q = new SelectQuery(Painting.class,
                    ExpressionFactory.matchExp("toArtist.artistName", "foo"));
            test.test(q);
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.performQuery()

           
            //testing quering from related table
            q = new SelectQuery(Painting.class,
                    ExpressionFactory.matchExp("toArtist.artistName", "foo"));
            test.test(q);
            context.performQuery(q);
           
            //testing flattened rels
            q = new SelectQuery(Artist.class, ExpressionFactory.matchExp("groupArray.name", "bar"));
            new Template() {
                @Override
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.performQuery()

                @Override
                void test(SelectTranslator transl) throws Exception {
                    assertTrue(transl.createSqlString().indexOf("GROUP_ID = ") > 0);
                }
            }.test(q);
            context.performQuery(q);
        }
        finally {
            entity.setQualifier(null);
            middleEntity.setQualifier(null);
        }
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.performQuery()

    public void testJoinToJoined() {
        ObjectContext context = createDataContext();

        EJBQLQuery query = new EJBQLQuery(
            "select g from Gallery g inner join g.paintingArray p where p.toArtist.artistName like '%a%'");
        context.performQuery(query);
    }



    public void testJoinAndCount() {
View Full Code Here

Examples of org.apache.cayenne.ObjectContext.performQuery()

        EJBQLQuery query = new EJBQLQuery(
            "select count(p) from Painting p where p.toGallery.galleryName LIKE '%a%' AND (" +
            "p.paintingTitle like '%a%' or " +
            "p.toArtist.artistName like '%a%'" +
            ")");
        context.performQuery(query);
    }

//    SELECT COUNT(p) from Product p where p.vsCatalog.id = 1 and
//    (
//    p.displayName like '%rimadyl%'
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.