Package org.apache.cayenne.exp

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


        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));
    }

    public void testEvaluateLIKE3() throws Exception {
        // test special chars
        Expression like = new ASTLike(new ASTObjPath("artistName"), "/./");
View Full Code Here


        // test special chars
        Expression like = new ASTLike(new ASTObjPath("artistName"), "/./");

        Artist noMatch1 = new Artist();
        noMatch1.setArtistName("/a/");
        assertFalse(like.match(noMatch1));

        Artist match = new Artist();
        match.setArtistName("/./");
        assertTrue("Failed: " + like, like.match(match));
    }
View Full Code Here

        noMatch1.setArtistName("/a/");
        assertFalse(like.match(noMatch1));

        Artist match = new Artist();
        match.setArtistName("/./");
        assertTrue("Failed: " + like, like.match(match));
    }

    public void testEvaluateLIKE_IGNORE_CASE() throws Exception {
        Expression like = new ASTLikeIgnoreCase(new ASTObjPath("artistName"), "aBcD");
        Expression notLike = new ASTNotLikeIgnoreCase(
View Full Code Here

                "aBcD");

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

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

        assertTrue(notLike.match(noMatch1));

        Artist match1 = new Artist();
        match1.setArtistName("abcd");
        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 testEvaluateADD() throws Exception {
        Expression add = new ASTAdd(new Object[] {
                new Integer(1), new Double(5.5)
View Full Code Here

        Expression equalTo = new ASTEqual(new ASTObjPath(
                Painting.ESTIMATED_PRICE_PROPERTY), bd1);

        Painting p = new Painting();
        p.setEstimatedPrice(bd2);
        assertTrue(equalTo.match(p));

        // BigDecimals must compare regardless of the number of trailing zeros
        // (see CAY-280)
        p.setEstimatedPrice(bd3);
        assertTrue(equalTo.match(p));
View Full Code Here

        assertTrue(equalTo.match(p));

        // BigDecimals must compare regardless of the number of trailing zeros
        // (see CAY-280)
        p.setEstimatedPrice(bd3);
        assertTrue(equalTo.match(p));

        p.setEstimatedPrice(bd4);
        assertFalse(equalTo.match(p));
    }
View Full Code Here

        // (see CAY-280)
        p.setEstimatedPrice(bd3);
        assertTrue(equalTo.match(p));

        p.setEstimatedPrice(bd4);
        assertFalse(equalTo.match(p));
    }

    public void testEvaluateEQUAL_TO() throws Exception {
        Expression equalTo = new ASTEqual(new ASTObjPath("artistName"), "abc");
        Expression notEqualTo = new ASTNotEqual(new ASTObjPath("artistName"), "abc");
View Full Code Here

        Expression notEqualTo = new ASTNotEqual(new ASTObjPath("artistName"), "abc");

        Artist match = new Artist();
        match.setArtistName("abc");
        assertTrue(equalTo.match(match));
        assertFalse(notEqualTo.match(match));

        Artist noMatch = new Artist();
        noMatch.setArtistName("123");
        assertFalse("Failed: " + equalTo, equalTo.match(noMatch));
        assertTrue("Failed: " + notEqualTo, notEqualTo.match(noMatch));
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.