use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class EmptyStringTest method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getEntityManager();
// Revision 1
em.getTransaction().begin();
StrTestEntity emptyEntity = new StrTestEntity("");
em.persist(emptyEntity);
StrTestEntity nullEntity = new StrTestEntity(null);
em.persist(nullEntity);
em.getTransaction().commit();
emptyId = emptyEntity.getId();
nullId = nullEntity.getId();
em.close();
em = getEntityManager();
// Should not generate revision afterQuery NULL to "" modification and vice versa on Oracle.
em.getTransaction().begin();
emptyEntity = em.find(StrTestEntity.class, emptyId);
emptyEntity.setStr(null);
em.merge(emptyEntity);
nullEntity = em.find(StrTestEntity.class, nullId);
nullEntity.setStr("");
em.merge(nullEntity);
em.getTransaction().commit();
em.close();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class GlobalVersioned method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getEntityManager();
em.getTransaction().begin();
BasicTestEntity4 bte1 = new BasicTestEntity4("x", "y");
em.persist(bte1);
id1 = bte1.getId();
em.getTransaction().commit();
em.getTransaction().begin();
bte1 = em.find(BasicTestEntity4.class, id1);
bte1.setStr1("a");
bte1.setStr2("b");
em.getTransaction().commit();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class ImmutableClassAccessType method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getEntityManager();
// Revision 1
em.getTransaction().begin();
country = Country.of(123, "Germany");
em.persist(country);
em.getTransaction().commit();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class PropertyAccessType method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getEntityManager();
em.getTransaction().begin();
PropertyAccessTypeEntity pate = new PropertyAccessTypeEntity("data");
em.persist(pate);
id1 = pate.getId();
em.getTransaction().commit();
em.getTransaction().begin();
pate = em.find(PropertyAccessTypeEntity.class, id1);
pate.writeData("data2");
em.getTransaction().commit();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class AuditReaderAPITest method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getEntityManager();
em.getTransaction().begin();
AuditedTestEntity ent1 = new AuditedTestEntity(1, "str1");
NotAuditedTestEntity ent2 = new NotAuditedTestEntity(1, "str1");
em.persist(ent1);
em.persist(ent2);
em.getTransaction().commit();
em.getTransaction().begin();
ent1 = em.find(AuditedTestEntity.class, 1);
ent2 = em.find(NotAuditedTestEntity.class, 1);
ent1.setStr1("str2");
ent2.setStr1("str2");
em.getTransaction().commit();
}
Aggregations