assertEquals(1, results.count());
assertEquals("bbb", results.get(0).text());
}
public void test05_queryingNulls() {
FirstEntity row1 = ERXEOControlUtilities.createAndInsertObject(ec, FirstEntity.class);
FirstEntity row2 = ERXEOControlUtilities.createAndInsertObject(ec, FirstEntity.class);
NSArray<FirstEntity> results;
row1.setText(null);
row2.setText("abc");
ec.saveChanges();
ec.invalidateAllObjects();
results = fetch(FirstEntity.ENTITY_NAME, ERXQ.isNull(FirstEntity.TEXT_KEY));
assertEquals(1, results.count());
assertEquals(row1, results.get(0));
assertNull(results.get(0).text());
results = fetch(FirstEntity.ENTITY_NAME, ERXQ.isNotNull(FirstEntity.TEXT_KEY));
assertEquals(1, results.count());
assertEquals(row2, results.get(0));
// test if clearing value will work correctly
row2.setText(null);
ec.saveChanges();
results = fetch(FirstEntity.ENTITY_NAME, ERXQ.isNull(FirstEntity.TEXT_KEY));
assertEquals(2, results.count());
}