use of org.hibernate.envers.test.integration.inheritance.joined.notownedrelation.Address in project hibernate-orm by hibernate.
the class HasChangedNotOwnedBidirectional method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getEntityManager();
pc_id = 1l;
a1_id = 10l;
a2_id = 100l;
// Rev 1
em.getTransaction().begin();
PersonalContact pc = new PersonalContact(pc_id, "e", "f");
Address a1 = new Address(a1_id, "a1");
a1.setContact(pc);
em.persist(pc);
em.persist(a1);
em.getTransaction().commit();
// Rev 2
em.getTransaction().begin();
pc = em.find(PersonalContact.class, pc_id);
Address a2 = new Address(a2_id, "a2");
a2.setContact(pc);
em.persist(a2);
em.getTransaction().commit();
}
Aggregations