use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class NamingSecondary method initData.
@Test
@Priority(10)
public void initData() {
SecondaryNamingTestEntity ste = new SecondaryNamingTestEntity("a", "1");
// Revision 1
EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist(ste);
em.getTransaction().commit();
// Revision 2
em.getTransaction().begin();
ste = em.find(SecondaryNamingTestEntity.class, ste.getId());
ste.setS1("b");
ste.setS2("2");
em.getTransaction().commit();
//
id = ste.getId();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class EmbIdSecondary method initData.
@Test
@Priority(10)
public void initData() {
id = new EmbId(1, 2);
SecondaryEmbIdTestEntity ste = new SecondaryEmbIdTestEntity(id, "a", "1");
// Revision 1
EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist(ste);
em.getTransaction().commit();
// Revision 2
em.getTransaction().begin();
ste = em.find(SecondaryEmbIdTestEntity.class, ste.getId());
ste.setS1("b");
ste.setS2("2");
em.getTransaction().commit();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class MulIdSecondary method initData.
@Test
@Priority(10)
public void initData() {
id = new MulId(1, 2);
SecondaryMulIdTestEntity ste = new SecondaryMulIdTestEntity(id, "a", "1");
// Revision 1
EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist(ste);
em.getTransaction().commit();
// Revision 2
em.getTransaction().begin();
ste = em.find(SecondaryMulIdTestEntity.class, id);
ste.setS1("b");
ste.setS2("2");
em.getTransaction().commit();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class CustomBoxed method initData.
@Test
@Priority(10)
public void initData() throws InterruptedException {
timestamp1 = System.currentTimeMillis();
Thread.sleep(100);
// Revision 1
EntityManager em = getEntityManager();
em.getTransaction().begin();
StrTestEntity te = new StrTestEntity("x");
em.persist(te);
id = te.getId();
em.getTransaction().commit();
timestamp2 = System.currentTimeMillis();
Thread.sleep(100);
// Revision 2
em.getTransaction().begin();
te = em.find(StrTestEntity.class, id);
te.setStr("y");
em.getTransaction().commit();
timestamp3 = System.currentTimeMillis();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class CustomColumnMapping method initData.
@Test
@Priority(10)
public void initData() throws InterruptedException {
timestamp1 = System.currentTimeMillis();
Thread.sleep(100);
// Revision 1
EntityManager em = getEntityManager();
em.getTransaction().begin();
StrTestEntity te = new StrTestEntity("x");
em.persist(te);
id = te.getId();
em.getTransaction().commit();
timestamp2 = System.currentTimeMillis();
Thread.sleep(100);
// Revision 2
em.getTransaction().begin();
te = em.find(StrTestEntity.class, id);
te.setStr("y");
em.getTransaction().commit();
timestamp3 = System.currentTimeMillis();
}
Aggregations