use of org.apache.cayenne.exp.parser.ASTBitwiseAnd in project cayenne by apache.
the class SelectQueryReturnTypesIT method testSelectBitwiseAnd.
@Test
public void testSelectBitwiseAnd() throws Exception {
if (!accessStackAdapter.supportsBitwiseOps()) {
return;
}
createNumericsDataSet();
// to simplify result checking, do double NOT
Expression left = new ASTBitwiseAnd(new Object[] { new ASTObjPath(ReturnTypesMap1.INTEGER_COLUMN.getName()), new ASTScalar(1) });
Expression right = new ASTScalar(0);
Expression equal = new ASTEqual();
equal.setOperand(0, left);
equal.setOperand(1, right);
List<ReturnTypesMap1> objects = ObjectSelect.query(ReturnTypesMap1.class, equal).select(context);
assertEquals(3, objects.size());
}
Aggregations