DataContext context = createDataContext();
// fetch
List ft3s = context.performQuery(new SelectQuery(FlattenedTest3.class));
assertEquals(1, ft3s.size());
FlattenedTest3 ft3 = (FlattenedTest3) ft3s.get(0);
// mark as dirty for the purpose of the test...
ft3.setPersistenceState(PersistenceState.MODIFIED);
assertTrue(ft3.readPropertyDirectly("toFT1") instanceof Fault);
// test that checking for modifications does not trigger a fault, and generally
// works well
ClassDescriptor d = context.getEntityResolver().getClassDescriptor(
"FlattenedTest3");
ArcProperty flattenedRel = (ArcProperty) d.getProperty("toFT1");
ObjectDiff diff = context.getObjectStore().registerDiff(ft3.getObjectId(), null);
assertFalse(DataRowUtils.isToOneTargetModified(flattenedRel, ft3, diff));
assertTrue(ft3.readPropertyDirectly("toFT1") instanceof Fault);
}