notThere.getFirstName();
}
public void testLazyLoading() {
try {
Person tony = new Person();
tony.setFirstName("Tony");
tony.setLastName("Blair");
tony.setDriversLicense(new DriversLicense("8439DK"));
sharedEntityManager.persist(tony);
setComplete();
endTransaction();
startNewTransaction();
sharedEntityManager.clear();
Person newTony = entityManagerFactory.createEntityManager().getReference(Person.class, tony.getId());
assertNotSame(newTony, tony);
endTransaction();
assertNotNull(newTony.getDriversLicense());
newTony.getDriversLicense().getSerialNumber();
}
finally {
deleteFromTables(new String[] { "person", "drivers_license" });
//setComplete();
}