context = createDataContext();
}
public void testReadRelationship() {
ToOneFK2 src = context.newObject(ToOneFK2.class);
ToOneFK1 target = context.newObject(ToOneFK1.class);
src.setToOneToFK(target);
context.commitChanges();
context.invalidateObjects(Arrays.asList(src, target));
ToOneFK2 src1 = (ToOneFK2) DataObjectUtils
.objectForPK(context, src.getObjectId());
assertNotNull(src1.getToOneToFK());
// resolve HOLLOW
assertSame(src1, src1.getToOneToFK().getToPK());
context.invalidateObjects(Arrays.asList(src1, src1.getToOneToFK()));
ToOneFK1 target2 = (ToOneFK1) DataObjectUtils.objectForPK(context, target
.getObjectId());
assertNotNull(target2.getToPK());
// resolve HOLLOW
assertSame(target2, target2.getToPK().getToOneToFK());
}