Package org.apache.cayenne.exp

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


        noMatch.setEstimatedPrice(new BigDecimal(9999));
        assertFalse(e.match(noMatch));

        Painting noMatch1 = new Painting();
        noMatch1.setEstimatedPrice(new BigDecimal(10000));
        assertFalse(e.match(noMatch1));

        Painting match = new Painting();
        match.setEstimatedPrice(new BigDecimal(10001));
        assertTrue("Failed: " + e, e.match(match));
    }
View Full Code Here


        noMatch1.setEstimatedPrice(new BigDecimal(10000));
        assertFalse(e.match(noMatch1));

        Painting match = new Painting();
        match.setEstimatedPrice(new BigDecimal(10001));
        assertTrue("Failed: " + e, e.match(match));
    }

    public void testEvaluateGREATER_THAN_EQUAL_TO() throws Exception {
        Expression e = new ASTGreaterOrEqual(
                new ASTObjPath("estimatedPrice"),
View Full Code Here

                new ASTObjPath("estimatedPrice"),
                new BigDecimal(10000d));

        Painting noMatch = new Painting();
        noMatch.setEstimatedPrice(new BigDecimal(9999));
        assertFalse(e.match(noMatch));

        Painting match1 = new Painting();
        match1.setEstimatedPrice(new BigDecimal(10000));
        assertTrue(e.match(match1));
View Full Code Here

        noMatch.setEstimatedPrice(new BigDecimal(9999));
        assertFalse(e.match(noMatch));

        Painting match1 = new Painting();
        match1.setEstimatedPrice(new BigDecimal(10000));
        assertTrue(e.match(match1));

        Painting match = new Painting();
        match.setEstimatedPrice(new BigDecimal(10001));
        assertTrue("Failed: " + e, e.match(match));
    }
View Full Code Here

        match1.setEstimatedPrice(new BigDecimal(10000));
        assertTrue(e.match(match1));

        Painting match = new Painting();
        match.setEstimatedPrice(new BigDecimal(10001));
        assertTrue("Failed: " + e, e.match(match));
    }

    public void testEvaluateBETWEEN() throws Exception {
        // evaluate both BETWEEN and NOT_BETWEEN
        Expression between = new ASTBetween(
View Full Code Here

                new BigDecimal(20d));

        Painting noMatch = new Painting();
        noMatch.setEstimatedPrice(new BigDecimal(21));
        assertFalse(between.match(noMatch));
        assertTrue(notBetween.match(noMatch));

        Painting match1 = new Painting();
        match1.setEstimatedPrice(new BigDecimal(20));
        assertTrue(between.match(match1));
        assertFalse(notBetween.match(match1));
View Full Code Here

        assertTrue(notBetween.match(noMatch));

        Painting match1 = new Painting();
        match1.setEstimatedPrice(new BigDecimal(20));
        assertTrue(between.match(match1));
        assertFalse(notBetween.match(match1));

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

        assertFalse(notBetween.match(match1));

        Painting match2 = new Painting();
        match2.setEstimatedPrice(new BigDecimal(10));
        assertTrue("Failed: " + between, between.match(match2));
        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));
View Full Code Here

        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

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.