tComplexJoin.insert(2001, 2, 3, "B");
tComplexJoin.insert(2002, 2, 3, "C");
}
public void testInsertJoinWithPK() throws Exception {
FlattenedTest1 obj01 = context.newObject(FlattenedTest1.class);
FlattenedTest3 obj11 = context.newObject(FlattenedTest3.class);
FlattenedTest3 obj12 = context.newObject(FlattenedTest3.class);
obj01.setName("t01");
obj11.setName("t11");
obj12.setName("t12");
obj01.addToFt3OverComplex(obj11);
obj01.addToFt3OverComplex(obj12);
context.commitChanges();
int pk = Cayenne.intPKForObject(obj01);
context.invalidateObjects(obj01, obj11, obj12);
FlattenedTest1 fresh01 = Cayenne.objectForPK(context1, FlattenedTest1.class, pk);
assertEquals("t01", fresh01.getName());
ValueHolder related = (ValueHolder) fresh01.getFt3OverComplex();
assertTrue(related.isFault());
assertEquals(2, ((List<?>) related).size());
}