use of ee.estonia.entities.Child in project hibernate-orm by hibernate.
the class EstonianTableAlias method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getEntityManager();
// Revision 1
em.getTransaction().begin();
Parent parent = new Parent("parent");
Child child = new Child("child");
parent.getCollection().add(child);
em.persist(child);
em.persist(parent);
em.getTransaction().commit();
parentId = parent.getId();
childId = child.getId();
}
use of ee.estonia.entities.Child in project hibernate-orm by hibernate.
the class EstonianTableAlias method testAuditChildTableAlias.
@Test
public void testAuditChildTableAlias() {
Parent parent = new Parent("parent", parentId);
Child child = new Child("child", childId);
Parent ver1 = getAuditReader().find(Parent.class, parentId, 1);
Assert.assertEquals(parent, ver1);
Assert.assertEquals(TestTools.makeSet(child), ver1.getCollection());
}
Aggregations