assertNotNull(painting);
assertNull(painting.getToArtist());
}
public void testRefetchRootWithChangedToOneTarget() throws Exception {
Painting painting = insertPaintingInContext("p");
Artist artistBefore = painting.getToArtist();
assertNotNull(artistBefore);
Artist artistAfter = fetchArtist("artist3", false);
assertNotNull(artistAfter);
assertNotSame(artistBefore, artistAfter);
// update via DataNode directly
updateRow(painting.getObjectId(), "ARTIST_ID", artistAfter
.getObjectId()
.getIdSnapshot()
.get("ARTIST_ID"));
// select without prefetch
painting = fetchPainting(painting.getPaintingTitle(), false);
assertNotNull(painting);
assertSame(artistAfter, painting.getToArtist());
}