use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class ColumnScalePrecisionTest method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getEntityManager();
// Revision 1
em.getTransaction().begin();
ScalePrecisionEntity entity = new ScalePrecisionEntity(13.0);
em.persist(entity);
em.getTransaction().commit();
id = entity.getId();
auditTable = metadata().getEntityBinding("org.hibernate.envers.test.integration.basic.ScalePrecisionEntity_AUD").getTable();
originalTable = metadata().getEntityBinding("org.hibernate.envers.test.integration.basic.ScalePrecisionEntity").getTable();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class OneToManyCache method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getEntityManager();
SetRefEdEntity ed1 = new SetRefEdEntity(1, "data_ed_1");
SetRefEdEntity ed2 = new SetRefEdEntity(2, "data_ed_2");
SetRefIngEntity ing1 = new SetRefIngEntity(1, "data_ing_1");
SetRefIngEntity ing2 = new SetRefIngEntity(2, "data_ing_2");
// Revision 1
em.getTransaction().begin();
em.persist(ed1);
em.persist(ed2);
ing1.setReference(ed1);
ing2.setReference(ed1);
em.persist(ing1);
em.persist(ing2);
em.getTransaction().commit();
// Revision 2
em.getTransaction().begin();
ing1 = em.find(SetRefIngEntity.class, ing1.getId());
ing2 = em.find(SetRefIngEntity.class, ing2.getId());
ed2 = em.find(SetRefEdEntity.class, ed2.getId());
ing1.setReference(ed2);
ing2.setReference(ed2);
em.getTransaction().commit();
//
ed1_id = ed1.getId();
ed2_id = ed2.getId();
ing1_id = ing1.getId();
ing2_id = ing2.getId();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class OneToOneCache method initData.
@Test
@Priority(10)
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();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class EnumMapTest method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getOrCreateEntityManager();
try {
// revision 1
EnumMapEntity entity = new EnumMapEntity();
entity.getTypes().put(EnumMapEntity.EnumType.TYPE_A, new EnumMapType("A"));
entity.getTypes().put(EnumMapEntity.EnumType.TYPE_B, new EnumMapType("B"));
em.getTransaction().begin();
em.persist(entity);
em.getTransaction().commit();
// revision 2
em.getTransaction().begin();
entity = em.find(EnumMapEntity.class, entity.getId());
entity.getTypes().remove(EnumMapEntity.EnumType.TYPE_A);
entity.getTypes().put(EnumMapEntity.EnumType.TYPE_C, new EnumMapType("C"));
em.getTransaction().commit();
entityId = entity.getId();
} finally {
em.close();
}
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class CollectionOfComponents method initData.
@Test
@Priority(10)
public void initData() {
// Revision 1
EntityManager em = getEntityManager();
em.getTransaction().begin();
ComponentSetTestEntity cte1 = new ComponentSetTestEntity();
ComponentSetTestEntity cte2 = new ComponentSetTestEntity();
cte2.getComps().add(new Component1("string1", null));
em.persist(cte2);
em.persist(cte1);
em.getTransaction().commit();
// Revision 2
em = getEntityManager();
em.getTransaction().begin();
cte1 = em.find(ComponentSetTestEntity.class, cte1.getId());
cte1.getComps().add(new Component1("a", "b"));
em.getTransaction().commit();
id1 = cte1.getId();
id2 = cte2.getId();
}
Aggregations