public void testAtomicBoolean() { AtomicBoolean isHappy = new AtomicBoolean(false); Query query = Query.select().where(Employee.IS_HAPPY.eq(isHappy)); SquidCursor<Employee> unhappyEmployee = database.query(Employee.class, query); try { assertEquals(1, unhappyEmployee.getCount()); unhappyEmployee.moveToFirst(); assertEquals(oscar.getRowId(), unhappyEmployee.get(Employee.ID).longValue()); } finally { unhappyEmployee.close(); } isHappy.set(true); SquidCursor<Employee> happyEmployees = database.query(Employee.class, query); try { assertEquals(5, happyEmployees.getCount()); } finally { happyEmployees.close(); } }
public Criterion isFalse() { return eq(Function.FALSE); }
public void testFunctionOnAmbiguousColumnName() { IntegerProperty happyCount = IntegerProperty.countProperty(Employee.IS_HAPPY, false); Query test = Query.select(TestModel.ID, TestModel.FIRST_NAME, TestModel.IS_HAPPY, happyCount) .join(Join.inner(Employee.TABLE, Employee.IS_HAPPY.eq(TestModel.IS_HAPPY))); // just test that the query compiles with the function database.query(TestModel.class, test); }
public Criterion isFalse() { return eq(Function.FALSE); }