use of org.hibernate.envers.test.entities.customtype.ParametrizedCustomTypeEntity 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.entities.customtype.ParametrizedCustomTypeEntity in project hibernate-orm by hibernate.
the class ParametrizedCustom method testHistoryOfCcte.
@Test
public void testHistoryOfCcte() {
ParametrizedCustomTypeEntity rev1 = getAuditReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 1);
ParametrizedCustomTypeEntity rev2 = getAuditReader().find(ParametrizedCustomTypeEntity.class, pcte_id, 2);
assert "xUy".equals(rev1.getStr());
assert "xVy".equals(rev2.getStr());
}
Aggregations