use of org.eclipse.persistence.testing.models.jpa.composite.advanced.member_1.Bungalow in project eclipselink by eclipse-ee4j.
the class EntityManagerJUnitTestSuite method testClassInstanceConverter.
public void testClassInstanceConverter() {
EntityManager em = createEntityManager();
beginTransaction(em);
Address add = new Address();
add.setCity("St. Louis");
add.setType(new Bungalow());
em.persist(add);
commitTransaction(em);
int assignedSequenceNumber = add.getID();
em.clear();
getDatabaseSession().getIdentityMapAccessor().initializeAllIdentityMaps();
add = em.find(Address.class, assignedSequenceNumber);
assertTrue("Did not correctly persist a mapping using a class-instance converter", (add.getType() instanceof Bungalow));
beginTransaction(em);
add = em.find(Address.class, assignedSequenceNumber);
em.remove(add);
commitTransaction(em);
}
use of org.eclipse.persistence.testing.models.jpa.composite.advanced.member_1.Bungalow in project eclipselink by eclipse-ee4j.
the class EntityMappingsAdvancedJUnitTestCase method testClassInstanceConverter.
public void testClassInstanceConverter() {
EntityManager em = createEntityManager();
beginTransaction(em);
Address add = new Address();
add.setCity("St. Louis");
add.setType(new Bungalow());
em.persist(add);
commitTransaction(em);
int assignedSequenceNumber = add.getId();
em.clear();
getDatabaseSession().getIdentityMapAccessor().initializeAllIdentityMaps();
add = em.find(Address.class, assignedSequenceNumber);
assertTrue("Did not correctly persist a mapping using a class-instance converter", (add.getType() instanceof Bungalow));
beginTransaction(em);
em.remove(add);
commitTransaction(em);
}
Aggregations