listener,
"publicCallback");
Artist a1 = context.newObject(Artist.class);
a1.setArtistName("XX");
Painting p1 = context.newObject(Painting.class);
p1.setToArtist(a1);
p1.setPaintingTitle("XXX");
context.commitChanges();
// reset context and read related object
context = createDataContext();
SelectQuery q = new SelectQuery(Painting.class);
q.addPrefetch(Painting.TO_ARTIST_PROPERTY);
p1 = (Painting) context.performQuery(q).get(0);
// artist is prefetched here, and a callback must have been invoked
a1 = p1.getToArtist();
assertEquals(PersistenceState.COMMITTED, a1.getPersistenceState());
assertEquals(1, a1.getPostLoaded());
assertSame(a1, listener.getPublicCalledbackEntity());
}