Package org.apache.cayenne.exp

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


        assertFalse("Failed: " + notBetween, notBetween.match(match2));

        Painting match3 = new Painting();
        match3.setEstimatedPrice(new BigDecimal(11));
        assertTrue("Failed: " + between, between.match(match3));
        assertFalse("Failed: " + notBetween, notBetween.match(match3));
    }

    public void testEvaluateIN() throws Exception {
        Expression in = new ASTIn(new ASTObjPath("estimatedPrice"), new ASTList(
                new Object[] {
View Full Code Here


                }));

        Painting noMatch1 = new Painting();
        noMatch1.setEstimatedPrice(new BigDecimal("21"));
        assertFalse(in.match(noMatch1));
        assertTrue(notIn.match(noMatch1));

        Painting noMatch2 = new Painting();
        noMatch2.setEstimatedPrice(new BigDecimal("11"));
        assertFalse("Failed: " + in, in.match(noMatch2));
        assertTrue("Failed: " + notIn, notIn.match(noMatch2));
View Full Code Here

        assertTrue(notIn.match(noMatch1));

        Painting noMatch2 = new Painting();
        noMatch2.setEstimatedPrice(new BigDecimal("11"));
        assertFalse("Failed: " + in, in.match(noMatch2));
        assertTrue("Failed: " + notIn, notIn.match(noMatch2));

        Painting match1 = new Painting();
        match1.setEstimatedPrice(new BigDecimal("20"));
        assertTrue(in.match(match1));
        assertFalse(notIn.match(match1));
View Full Code Here

        assertTrue("Failed: " + notIn, notIn.match(noMatch2));

        Painting match1 = new Painting();
        match1.setEstimatedPrice(new BigDecimal("20"));
        assertTrue(in.match(match1));
        assertFalse(notIn.match(match1));

        Painting match2 = new Painting();
        match2.setEstimatedPrice(new BigDecimal("10"));
        assertTrue("Failed: " + in, in.match(match2));
        assertFalse("Failed: " + notIn, notIn.match(match2));
View Full Code Here

        assertFalse(notIn.match(match1));

        Painting match2 = new Painting();
        match2.setEstimatedPrice(new BigDecimal("10"));
        assertTrue("Failed: " + in, in.match(match2));
        assertFalse("Failed: " + notIn, notIn.match(match2));
    }

    public void testEvaluateLIKE1() throws Exception {
        Expression like = new ASTLike(new ASTObjPath("artistName"), "abc%d");
        Expression notLike = new ASTNotLike(new ASTObjPath("artistName"), "abc%d");
View Full Code Here

        Expression notLike = new ASTNotLike(new ASTObjPath("artistName"), "abc%d");

        Artist noMatch = new Artist();
        noMatch.setArtistName("dabc");
        assertFalse(like.match(noMatch));
        assertTrue(notLike.match(noMatch));

        Artist match1 = new Artist();
        match1.setArtistName("abc123d");
        assertTrue("Failed: " + like, like.match(match1));
        assertFalse("Failed: " + notLike, notLike.match(match1));
View Full Code Here

        assertTrue(notLike.match(noMatch));

        Artist match1 = new Artist();
        match1.setArtistName("abc123d");
        assertTrue("Failed: " + like, like.match(match1));
        assertFalse("Failed: " + notLike, notLike.match(match1));

        Artist match2 = new Artist();
        match2.setArtistName("abcd");
        assertTrue("Failed: " + like, like.match(match2));
        assertFalse("Failed: " + notLike, notLike.match(match2));
View Full Code Here

        assertFalse("Failed: " + notLike, notLike.match(match1));

        Artist match2 = new Artist();
        match2.setArtistName("abcd");
        assertTrue("Failed: " + like, like.match(match2));
        assertFalse("Failed: " + notLike, notLike.match(match2));
    }

    public void testEvaluateLIKE2() throws Exception {
        Expression like = new ASTLike(new ASTObjPath("artistName"), "abc?d");
        Expression notLike = new ASTNotLike(new ASTObjPath("artistName"), "abc?d");
View Full Code Here

        Expression notLike = new ASTNotLike(new ASTObjPath("artistName"), "abc?d");

        Artist noMatch1 = new Artist();
        noMatch1.setArtistName("dabc");
        assertFalse(like.match(noMatch1));
        assertTrue(notLike.match(noMatch1));

        Artist noMatch2 = new Artist();
        noMatch2.setArtistName("abc123d");
        assertFalse("Failed: " + like, like.match(noMatch2));
        assertTrue("Failed: " + notLike, notLike.match(noMatch2));
View Full Code Here

        assertTrue(notLike.match(noMatch1));

        Artist noMatch2 = new Artist();
        noMatch2.setArtistName("abc123d");
        assertFalse("Failed: " + like, like.match(noMatch2));
        assertTrue("Failed: " + notLike, notLike.match(noMatch2));

        Artist match = new Artist();
        match.setArtistName("abcXd");
        assertTrue("Failed: " + like, like.match(match));
        assertFalse("Failed: " + notLike, notLike.match(match));
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.