Search in sources :

Example 21 with SetRefEdEntity

use of org.hibernate.envers.test.entities.onetomany.SetRefEdEntity in project hibernate-orm by hibernate.

the class BasicSetWithNullsDelete method testHistoryOfEdIng3.

@Test
public void testHistoryOfEdIng3() {
    SetRefEdEntity ed1 = new SetRefEdEntity(1, "data_ed_1");
    SetRefEdEntity ed2 = new SetRefEdEntity(2, "data_ed_2");
    SetRefIngEntity rev1 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 1);
    SetRefIngEntity rev2 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 2);
    SetRefIngEntity rev3 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 3);
    SetRefIngEntity rev4 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 4);
    SetRefIngEntity rev5 = getAuditReader().find(SetRefIngEntity.class, ing3_id, 5);
    assert rev1.getReference().equals(ed1);
    assert rev2.getReference().equals(ed1);
    assert rev3.getReference().equals(ed1);
    assert rev4.getReference().equals(ed2);
    assert rev5.getReference().equals(ed2);
}
Also used : SetRefIngEntity(org.hibernate.envers.test.entities.onetomany.SetRefIngEntity) SetRefEdEntity(org.hibernate.envers.test.entities.onetomany.SetRefEdEntity) Test(org.junit.Test)

Aggregations

SetRefEdEntity (org.hibernate.envers.test.entities.onetomany.SetRefEdEntity)21 Test (org.junit.Test)21 SetRefIngEntity (org.hibernate.envers.test.entities.onetomany.SetRefIngEntity)20 EntityManager (javax.persistence.EntityManager)6 Priority (org.hibernate.envers.test.Priority)6 HashSet (java.util.HashSet)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Session (org.hibernate.Session)1 IntTestPrivSeqEntity (org.hibernate.envers.test.entities.IntTestPrivSeqEntity)1 StrTestPrivSeqEntity (org.hibernate.envers.test.entities.StrTestPrivSeqEntity)1 UnversionedStrTestEntity (org.hibernate.envers.test.entities.UnversionedStrTestEntity)1 StringSetEntity (org.hibernate.envers.test.entities.collection.StringSetEntity)1 ListOwnedEntity (org.hibernate.envers.test.entities.manytomany.ListOwnedEntity)1 ListOwningEntity (org.hibernate.envers.test.entities.manytomany.ListOwningEntity)1 SetOwnedEntity (org.hibernate.envers.test.entities.manytomany.SetOwnedEntity)1 SetOwningEntity (org.hibernate.envers.test.entities.manytomany.SetOwningEntity)1 M2MIndexedListTargetNotAuditedEntity (org.hibernate.envers.test.entities.manytomany.unidirectional.M2MIndexedListTargetNotAuditedEntity)1 CollectionRefEdEntity (org.hibernate.envers.test.entities.onetomany.CollectionRefEdEntity)1 CollectionRefIngEntity (org.hibernate.envers.test.entities.onetomany.CollectionRefIngEntity)1