assertEquals(1, results.count());
assertEquals(row1a, results.get(0));
}
public void test21_insertJoinEntity_explicit() {
FirstEntity first = ERXEOControlUtilities.createAndInsertObject(ec, FirstEntity.class);
SecondEntity second = ERXEOControlUtilities.createAndInsertObject(ec, SecondEntity.class);
// explicit create Join row
Join join = ERXEOControlUtilities.createAndInsertObject(ec, Join.class);
join.setFirstEntityRelationship(first);
join.setSecondEntityRelationship(second);
ec.saveChanges();
ec.invalidateAllObjects();
NSArray<FirstEntity> results = fetchAll(FirstEntity.ENTITY_NAME);
assertEquals("Expecting only one row", 1, results.count());
first = results.get(0);
assertEquals(1, first.joins().count());
assertEquals(second, first.joins().get(0).secondEntity());
NSArray<SecondEntity> results2 = fetchAll(SecondEntity.ENTITY_NAME);
assertEquals("Expecting only one row", 1, results2.count());
second = results2.get(0);
assertEquals(1, second.joins().count());