use of org.hibernate.envers.AuditReader in project hibernate-orm by hibernate.
the class CustomBoxed method testFindRevisions.
@Test
public void testFindRevisions() {
AuditReader vr = getAuditReader();
Set<Number> revNumbers = new HashSet<Number>();
revNumbers.add(1);
revNumbers.add(2);
Map<Number, CustomBoxedRevEntity> revisionMap = vr.findRevisions(CustomBoxedRevEntity.class, revNumbers);
assert (revisionMap.size() == 2);
assert (revisionMap.get(1).equals(vr.findRevision(CustomBoxedRevEntity.class, 1)));
assert (revisionMap.get(2).equals(vr.findRevision(CustomBoxedRevEntity.class, 2)));
}
use of org.hibernate.envers.AuditReader in project hibernate-orm by hibernate.
the class CustomColumnMapping method testFindRevision.
@Test
public void testFindRevision() {
AuditReader vr = getAuditReader();
long rev1Timestamp = vr.findRevision(CustomRevEntityColumnMapping.class, 1l).getCustomTimestamp();
assert rev1Timestamp > timestamp1;
assert rev1Timestamp <= timestamp2;
long rev2Timestamp = vr.findRevision(CustomRevEntityColumnMapping.class, 2l).getCustomTimestamp();
assert rev2Timestamp > timestamp2;
assert rev2Timestamp <= timestamp3;
}
use of org.hibernate.envers.AuditReader in project hibernate-orm by hibernate.
the class CustomPropertyAccess method testFindRevision.
@Test
public void testFindRevision() {
AuditReader vr = getAuditReader();
long rev1Timestamp = vr.findRevision(CustomPropertyAccessRevEntity.class, 1).getCustomTimestamp();
assert rev1Timestamp > timestamp1;
assert rev1Timestamp <= timestamp2;
long rev2Timestamp = vr.findRevision(CustomPropertyAccessRevEntity.class, 2).getCustomTimestamp();
assert rev2Timestamp > timestamp2;
assert rev2Timestamp <= timestamp3;
}
use of org.hibernate.envers.AuditReader in project hibernate-orm by hibernate.
the class Inherited method testFindRevision.
@Test
public void testFindRevision() {
AuditReader vr = getAuditReader();
long rev1Timestamp = vr.findRevision(InheritedRevEntity.class, 1).getTimestamp();
assert rev1Timestamp > timestamp1;
assert rev1Timestamp <= timestamp2;
long rev2Timestamp = vr.findRevision(InheritedRevEntity.class, 2).getTimestamp();
assert rev2Timestamp > timestamp2;
assert rev2Timestamp <= timestamp3;
}
use of org.hibernate.envers.AuditReader in project hibernate-orm by hibernate.
the class Listener method testFindRevisions.
@Test
public void testFindRevisions() {
AuditReader vr = getAuditReader();
Set<Number> revNumbers = new HashSet<Number>();
revNumbers.add(1);
revNumbers.add(2);
Map<Number, ListenerRevEntity> revisionMap = vr.findRevisions(ListenerRevEntity.class, revNumbers);
assert (revisionMap.size() == 2);
assert (revisionMap.get(1).equals(vr.findRevision(ListenerRevEntity.class, 1)));
assert (revisionMap.get(2).equals(vr.findRevision(ListenerRevEntity.class, 2)));
}
Aggregations