use of org.hibernate.envers.test.entities.StrTestEntity in project hibernate-orm by hibernate.
the class TrackingEntitiesMultipleChangesTest method testTrackUpdateAndRemoveDifferentEntities.
@Test
public void testTrackUpdateAndRemoveDifferentEntities() {
StrTestEntity ste1 = new StrTestEntity("z", steId1);
StrTestEntity ste2 = new StrTestEntity(null, steId2);
Assert.assertEquals(TestTools.makeSet(ste1, ste2), new HashSet<Object>(getCrossTypeRevisionChangesReader().findEntities(2)));
}
use of org.hibernate.envers.test.entities.StrTestEntity in project hibernate-orm by hibernate.
the class Custom 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.entities.StrTestEntity in project hibernate-orm by hibernate.
the class Custom method testHistoryOfId1.
@Test
public void testHistoryOfId1() {
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
use of org.hibernate.envers.test.entities.StrTestEntity in project hibernate-orm by hibernate.
the class CustomBoxed method testHistoryOfId1.
@Test
public void testHistoryOfId1() {
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
use of org.hibernate.envers.test.entities.StrTestEntity in project hibernate-orm by hibernate.
the class CustomDate method testHistoryOfId1.
@Test
public void testHistoryOfId1() {
StrTestEntity ver1 = new StrTestEntity("x", id);
StrTestEntity ver2 = new StrTestEntity("y", id);
assert getAuditReader().find(StrTestEntity.class, id, 1).equals(ver1);
assert getAuditReader().find(StrTestEntity.class, id, 2).equals(ver2);
}
Aggregations