Examples of andQualifier()


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

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

        SelectQuery query = new SelectQuery(Artist.class);
        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);
View Full Code Here

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

                "INSERT INTO PAINTING (PAINTING_ID, ARTIST_ID, PAINTING_TITLE)"
                        + " VALUES (3, 2, 'X')"));

        SelectQuery query = new SelectQuery(Artist.class);
        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());
View Full Code Here

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

        context.performGenericQuery(new SQLTemplate(
                EnumEntity.class,
                "insert into ENUM_ENTITY (ID, ENUM_ATTRIBUTE) VALUES (2, 'one')"));

        SelectQuery q = new SelectQuery(EnumEntity.class);
        q.andQualifier(ExpressionFactory.matchExp(
                EnumEntity.ENUM_ATTRIBUTE_PROPERTY,
                Enum1.one));

        EnumEntity e = (EnumEntity) Cayenne.objectForQuery(context, q);
        assertNotNull(e);
View Full Code Here

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

     */
    public void testCreateSqlString5() throws Exception {
        // query with qualifier and ordering
        SelectQuery q = new SelectQuery(ArtistExhibit.class);
        q.setQualifier(ExpressionFactory.likeExp("toArtist.artistName", "a%"));
        q.andQualifier(ExpressionFactory.likeExp(
                "toExhibit.toGallery.paintingArray.toArtist.artistName",
                "a%"));

        Template test = new Template() {

View Full Code Here

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

     */
    public void testCreateSqlString6() throws Exception {
        // query with qualifier and ordering
        SelectQuery q = new SelectQuery(ArtistExhibit.class);
        q.setQualifier(ExpressionFactory.likeExp("toArtist.artistName", "a%"));
        q.andQualifier(ExpressionFactory.likeExp(
                "toArtist.paintingArray.paintingTitle",
                "p%"));

        Template test = new Template() {

View Full Code Here

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

     * "Artist.dateOfBirth > ? AND Artist.dateOfBirth < ?".
     */
    public void testCreateSqlString7() throws Exception {
        SelectQuery q = new SelectQuery(Artist.class);
        q.setQualifier(ExpressionFactory.greaterExp("dateOfBirth", new Date()));
        q.andQualifier(ExpressionFactory.lessExp("dateOfBirth", new Date()));

        Template test = new Template() {

            @Override
            void test(SelectTranslator transl) throws Exception {
View Full Code Here

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

     */
    public void testCreateSqlString8() throws Exception {
        SelectQuery q = new SelectQuery();
        q.setRoot(Painting.class);
        q.setQualifier(ExpressionFactory.greaterExp("toArtist.dateOfBirth", new Date()));
        q.andQualifier(ExpressionFactory.lessExp("toArtist.dateOfBirth", new Date()));

        Template test = new Template() {

            @Override
            void test(SelectTranslator transl) throws Exception {
View Full Code Here

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

        try {
            SelectQuery q = new SelectQuery(Artist.class);
            DbEntity entity = getDbEntity("ARTIST");
            entity.getDataMap().setQuotingSQLIdentifiers(true);
            q.setQualifier(ExpressionFactory.greaterExp("dateOfBirth", new Date()));
            q.andQualifier(ExpressionFactory.lessExp("dateOfBirth", new Date()));

            Template test = new Template() {

                @Override
                void test(SelectTranslator transl) throws Exception {
View Full Code Here

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

        tMtTable1.insert(1, "a", "XX", null);
        tMtTable1.insert(2, "sub1", "XXA", "sa1");
        tMtTable1.insert(3, "z", "MM", null);

        SelectQuery query = new SelectQuery(ClientMtTable1.class);
        query.andQualifier(ExpressionFactory.likeExp(
                ClientMtTable1.SERVER_ATTRIBUTE1_PROPERTY,
                "X%"));
        List<ClientMtTable1> objects = context.performQuery(query);

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

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

                        "INSERT INTO PAINTING (PAINTING_ID, ARTIST_ID, PAINTING_TITLE) VALUES (3, 1, 'ACC')"));

        createDataContext().performGenericQuery(data);

        SelectQuery query = new SelectQuery(Artist.class);
        query.andQualifier(ExpressionFactory
                .likeExp("paintingArray.paintingTitle", "AB%"));
        query.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY).setSemantics(
                PrefetchTreeNode.DISJOINT_PREFETCH_SEMANTICS);

        List<Artist> result = createDataContext().performQuery(query);
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.