7576777879808182838485
NSArray<City> cities = City.fetchCities(ec, City.COUNTRY.dot(Country.CODE).eq("NLD"), null); assertNotNull(cities); assertEquals(28, cities.count()); } finally { ec.unlock(); } } public void testLeftJoin() { ERXEC ec = (ERXEC) ERXEC.newEditingContext();
9293949596979899100101102
, Country.NAME.ascs()); assertNotNull(countries); assertEquals(2, countries.count()); } finally { ec.unlock(); } } public void testSortOrder() {
110111112113114115116117118119120
City city = cities.objectAtIndex(0); assertNotNull(city); log.debug(city.name()); assertEquals("Alkmaar", city.name()); } finally { ec.unlock(); } } public void testBatchFetch() { ERXEC ec = (ERXEC) ERXEC.newEditingContext();
125126127128129130131132133134135
assertNotNull(countries); assertEquals(2, countries.count()); ERXBatchFetchUtilities.batchFetch(countries, Country.CITIES_KEY); } finally { ec.unlock(); } } public void testLimitedFetch() { ERXEC ec = (ERXEC) ERXEC.newEditingContext();
140141142143144145146147148149150
NSArray<City> cities = ERXEOControlUtilities.objectsInRange(ec, fs, 1, 5); assertNotNull(cities); assertEquals(4, cities.count()); } finally { ec.unlock(); } } public void testMoreComplexLimitedFetch() {
156157158159160161162163164165166
NSArray<City> cities = ERXEOControlUtilities.objectsInRange(ec, fs, 1, 5); assertNotNull(cities); assertEquals(4, cities.count()); } finally { ec.unlock(); } } //