Search in sources :

Example 1 with CustomRevEntity

use of org.hibernate.envers.test.entities.reventity.CustomRevEntity in project hibernate-orm by hibernate.

the class Custom method testFindRevisions.

@Test
public void testFindRevisions() {
    AuditReader vr = getAuditReader();
    Set<Number> revNumbers = new HashSet<Number>();
    revNumbers.add(1);
    revNumbers.add(2);
    Map<Number, CustomRevEntity> revisionMap = vr.findRevisions(CustomRevEntity.class, revNumbers);
    assert (revisionMap.size() == 2);
    assert (revisionMap.get(1).equals(vr.findRevision(CustomRevEntity.class, 1)));
    assert (revisionMap.get(2).equals(vr.findRevision(CustomRevEntity.class, 2)));
}
Also used : CustomRevEntity(org.hibernate.envers.test.entities.reventity.CustomRevEntity) AuditReader(org.hibernate.envers.AuditReader) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)1 AuditReader (org.hibernate.envers.AuditReader)1 CustomRevEntity (org.hibernate.envers.test.entities.reventity.CustomRevEntity)1 Test (org.junit.Test)1