Integer cnt = ERXEOControlUtilities.objectCountWithQualifier(ec, City.ENTITY_NAME, City.DISTICT.eq("DC"));
assertNotNull(cnt);
assertEquals(Integer.valueOf(1), cnt);
Country country = Country.createCountry(ec, "USA", "United States of America");
country.setCapital(city);
try {
// make sure blobs work
NSData flag = new NSData(ERXFileUtilities.inputStreamForResourceNamed("us.png", null, null), 1024);
country.setFlag(flag);
} catch (IOException e) {
log.error(org.apache.commons.lang.exception.ExceptionUtils.getFullStackTrace(e), e);
throw new RuntimeException(e.getMessage(), e);
}
ec.saveChanges();