use of org.apache.cayenne.testdo.cay_2666.CAY2666 in project cayenne by apache.
the class Cay2666IT method testExpressionWithDollarSign.
@Test
public void testExpressionWithDollarSign() throws Exception {
tTest = new TableHelper(dbHelper, "Cay2666");
tTest.setColumns("ID", "NAME$");
tTest.insert(1, "st.One");
Expression expression = ExpressionFactory.exp("name$ = 'st.One'");
List<CAY2666> cay2666List = ObjectSelect.query(CAY2666.class).where(expression).select(context);
assertEquals(1, cay2666List.size());
expression = ExpressionFactory.exp("obj:name$ = 'st.Two'");
cay2666List = ObjectSelect.query(CAY2666.class).where(expression).select(context);
assertEquals(0, cay2666List.size());
tTest.insert(2, "st.Two");
expression = ExpressionFactory.exp("db:NAME$ = 'st.Two'");
cay2666List = ObjectSelect.query(CAY2666.class).where(expression).select(context);
assertEquals(1, cay2666List.size());
}
Aggregations