cfg.addAnnotatedClass(BiRefIngEntity.class);
}
@BeforeClass(dependsOnMethods = "init")
public void initData() {
BiRefEdEntity ed1 = new BiRefEdEntity(1, "data_ed_1");
BiRefEdEntity ed2 = new BiRefEdEntity(2, "data_ed_2");
BiRefIngEntity ing1 = new BiRefIngEntity(3, "data_ing_1");
// Revision 1
EntityManager em = getEntityManager();
em.getTransaction().begin();
ing1.setReference(ed1);
em.persist(ed1);
em.persist(ed2);
em.persist(ing1);
em.getTransaction().commit();
// Revision 2
em.getTransaction().begin();
ing1 = em.find(BiRefIngEntity.class, ing1.getId());
ed2 = em.find(BiRefEdEntity.class, ed2.getId());
ing1.setReference(ed2);
em.getTransaction().commit();
//
ed1_id = ed1.getId();
ed2_id = ed2.getId();
ing1_id = ing1.getId();
}