Package org.hibernate.envers

Examples of org.hibernate.envers.AuditReader.findRevision()


    @Test
    public void testFindRevision() {
        AuditReader vr = getAuditReader();

        long rev1Timestamp = vr.findRevision(CustomRevEntity.class, 1).getCustomTimestamp();
        assert rev1Timestamp > timestamp1;
        assert rev1Timestamp <= timestamp2;

        long rev2Timestamp = vr.findRevision(CustomRevEntity.class, 2).getCustomTimestamp();
        assert rev2Timestamp > timestamp2;
View Full Code Here


        long rev1Timestamp = vr.findRevision(CustomRevEntity.class, 1).getCustomTimestamp();
        assert rev1Timestamp > timestamp1;
        assert rev1Timestamp <= timestamp2;

        long rev2Timestamp = vr.findRevision(CustomRevEntity.class, 2).getCustomTimestamp();
        assert rev2Timestamp > timestamp2;
        assert rev2Timestamp <= timestamp3;
    }

    @Test
View Full Code Here

        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)));
    }

    @Test
    public void testRevisionsCounts() {
View Full Code Here

        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)));
    }

    @Test
    public void testRevisionsCounts() {
        assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
View Full Code Here

    @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;
View Full Code Here

        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;
    }

    @Test
View Full Code Here

    @Test
    public void testFindRevision() {
        AuditReader vr = getAuditReader();

        ListenerRevEntity rev1Data = vr.findRevision(ListenerRevEntity.class, 1);
        ListenerRevEntity rev2Data = vr.findRevision(ListenerRevEntity.class, 2);

        long rev1Timestamp = rev1Data.getTimestamp();
        assert rev1Timestamp > timestamp1;
        assert rev1Timestamp <= timestamp2;
View Full Code Here

    @Test
    public void testFindRevision() {
        AuditReader vr = getAuditReader();

        ListenerRevEntity rev1Data = vr.findRevision(ListenerRevEntity.class, 1);
        ListenerRevEntity rev2Data = vr.findRevision(ListenerRevEntity.class, 2);

        long rev1Timestamp = rev1Data.getTimestamp();
        assert rev1Timestamp > timestamp1;
        assert rev1Timestamp <= timestamp2;
View Full Code Here

        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)));
    }

    @Test
    public void testRevisionsCounts() {
View Full Code Here

        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)));
    }

    @Test
    public void testRevisionsCounts() {
        assert Arrays.asList(1, 2).equals(getAuditReader().getRevisions(StrTestEntity.class, id));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.