Package org.apache.cayenne.exp

Examples of org.apache.cayenne.exp.Expression.orExp()


    public void testSelectBooleanNotTrueOr() throws Exception {
        createArtistsDataSet();
        SelectQuery query = new SelectQuery(Artist.class);
        Expression qual = ExpressionFactory.expTrue();
        qual = qual.notExp();
        qual = qual.orExp(ExpressionFactory.matchExp("artistName", "artist1"));
        query.setQualifier(qual);
        List objects = context.performQuery(query);
        assertEquals(1, objects.size());
    }
View Full Code Here


    public void testSelectBooleanFalseOr() throws Exception {
        createArtistsDataSet();
        SelectQuery query = new SelectQuery(Artist.class);
        Expression qual = ExpressionFactory.expFalse();
        qual = qual.orExp(ExpressionFactory.matchExp("artistName", "artist1"));
        query.setQualifier(qual);
        List objects = context.performQuery(query);
        assertEquals(1, objects.size());
    }
View Full Code Here

    public void testSelectBooleanNotTrueOr() throws Exception {
        createArtistsDataSet();
        SelectQuery query = new SelectQuery(Artist.class);
        Expression qual = ExpressionFactory.expTrue();
        qual = qual.notExp();
        qual = qual.orExp(ExpressionFactory.matchExp("artistName", "artist1"));
        query.setQualifier(qual);
        List<?> objects = context.performQuery(query);
        assertEquals(1, objects.size());
    }
View Full Code Here

    public void testSelectBooleanFalseOr() throws Exception {
        createArtistsDataSet();
        SelectQuery query = new SelectQuery(Artist.class);
        Expression qual = ExpressionFactory.expFalse();
        qual = qual.orExp(ExpressionFactory.matchExp("artistName", "artist1"));
        query.setQualifier(qual);
        List<?> objects = context.performQuery(query);
        assertEquals(1, objects.size());
    }
View Full Code Here

                firstId.getIdSnapshot(),
                Expression.EQUAL_TO);

        while (it.hasNext()) {
            ObjectId anId = (ObjectId) it.next();
            exp = exp.orExp(ExpressionFactory.matchAllDbExp(
                    anId.getIdSnapshot(),
                    Expression.EQUAL_TO));
        }

        sel.setQualifier(exp);
View Full Code Here

    public void testSelectBooleanNotTrueOr() throws Exception {
        createArtistsDataSet();
        SelectQuery query = new SelectQuery(Artist.class);
        Expression qual = ExpressionFactory.expTrue();
        qual = qual.notExp();
        qual = qual.orExp(ExpressionFactory.matchExp("artistName", "artist1"));
        query.setQualifier(qual);
        List<?> objects = context.performQuery(query);
        assertEquals(1, objects.size());
    }
View Full Code Here

    public void testSelectBooleanFalseOr() throws Exception {
        createArtistsDataSet();
        SelectQuery query = new SelectQuery(Artist.class);
        Expression qual = ExpressionFactory.expFalse();
        qual = qual.orExp(ExpressionFactory.matchExp("artistName", "artist1"));
        query.setQualifier(qual);
        List<?> objects = context.performQuery(query);
        assertEquals(1, objects.size());
    }
View Full Code Here

    public void testSelectBooleanNotTrueOr() throws Exception {
        query.setRoot(Artist.class);
        Expression qual = ExpressionFactory.expTrue();
        qual = qual.notExp();
        qual = qual.orExp(ExpressionFactory.matchExp("artistName", "artist1"));
        query.setQualifier(qual);
        performQuery();

        // check query results
        List objects = opObserver.rowsForQuery(query);
View Full Code Here

    }

    public void testSelectBooleanFalseOr() throws Exception {
        query.setRoot(Artist.class);
        Expression qual = ExpressionFactory.expFalse();
        qual = qual.orExp(ExpressionFactory.matchExp("artistName", "artist1"));
        query.setQualifier(qual);
        performQuery();

        // check query results
        List objects = opObserver.rowsForQuery(query);
View Full Code Here

    public void testSelectBooleanNotTrueOr() throws Exception {
        createArtistsDataSet();
        SelectQuery query = new SelectQuery(Artist.class);
        Expression qual = ExpressionFactory.expTrue();
        qual = qual.notExp();
        qual = qual.orExp(ExpressionFactory.matchExp("artistName", "artist1"));
        query.setQualifier(qual);
        List<?> objects = context.performQuery(query);
        assertEquals(1, objects.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.