use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class CollectionOfMappedSuperclassComponentsTest method initData.
@Test
@Priority(10)
public void initData() {
// Revision 1
EntityManager em = getEntityManager();
em.getTransaction().begin();
MappedSuperclassComponentSetTestEntity cte1 = new MappedSuperclassComponentSetTestEntity();
em.persist(cte1);
em.getTransaction().commit();
// Revision 2
em = getEntityManager();
em.getTransaction().begin();
cte1 = em.find(MappedSuperclassComponentSetTestEntity.class, cte1.getId());
cte1.getComps().add(new Code(1));
cte1.getCompsNotAudited().add(new Code(100));
em.getTransaction().commit();
id1 = cte1.getId();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class EnumTypeTest method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getEntityManager();
em.getTransaction().begin();
EnumTypeEntity entity = new EnumTypeEntity(EnumTypeEntity.E1.X, EnumTypeEntity.E2.A);
em.persist(entity);
em.getTransaction().commit();
em.close();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class ParametrizedCustom method initData.
@Test
@Priority(10)
public void initData() {
EntityManager em = getEntityManager();
ParametrizedCustomTypeEntity pcte = new ParametrizedCustomTypeEntity();
// Revision 1 (persisting 1 entity)
em.getTransaction().begin();
pcte.setStr("U");
em.persist(pcte);
em.getTransaction().commit();
// Revision 2 (changing the value)
em.getTransaction().begin();
pcte = em.find(ParametrizedCustomTypeEntity.class, pcte.getId());
pcte.setStr("V");
em.getTransaction().commit();
//
pcte_id = pcte.getId();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class UnspecifiedEnumTypeTest method prepareSchema.
@Test
@Priority(10)
public void prepareSchema() {
Session session = openSession();
dropSchema(session);
createSchema(session);
session.close();
}
use of org.hibernate.envers.test.Priority in project hibernate-orm by hibernate.
the class UnspecifiedEnumTypeTest method testEnumRepresentation.
@Test
@Priority(6)
public void testEnumRepresentation() {
Session session = getSession();
List<Object[]> values = session.createSQLQuery("SELECT enum1, enum2 FROM enum_entity_aud ORDER BY rev ASC").list();
session.close();
Assert.assertNotNull(values);
Assert.assertEquals(2, values.size());
Assert.assertArrayEquals(new Object[] { 0, 0 }, values.get(0));
Assert.assertArrayEquals(new Object[] { 1, 1 }, values.get(1));
}
Aggregations