Package org.apache.cayenne.exp

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


                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

        ObjEntity entity = context.getEntityResolver().getObjEntity("Artist");

        Expression exp = ExpressionFactory.noMatchExp("dateOfBirth", null);
        Expression translated = entity.translateToDbPath(exp);

        assertFalse(translated.match(new Artist()));
    }
}
View Full Code Here

            }
        }

        Expression qualifier = getDbQualifier();
        if (qualifier != null) {
            return qualifier.match(row) ? entity : null;
        }

        // no qualifier ... matches all rows
        return entity;
    }
View Full Code Here

            }
        }

        Expression qualifier = getDbQualifier();
        if (qualifier != null) {
            return qualifier.match(row) ? entity : null;
        }

        // no qualifier ... matches all rows
        return entity;
    }
View Full Code Here

        ObjEntity entity = context.getEntityResolver().getObjEntity("Artist");

        Expression exp = ExpressionFactory.noMatchExp("dateOfBirth", null);
        Expression translated = entity.translateToDbPath(exp);

        assertFalse(translated.match(new Artist()));
    }
}
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

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.