Search in sources :

Example 6 with SetRefEdMulIdEntity

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

the class BasicSetWithMulId method testHistoryOfEdIng2.

@Test
public void testHistoryOfEdIng2() {
    SetRefEdMulIdEntity ed1 = getEntityManager().find(SetRefEdMulIdEntity.class, ed1_id);
    SetRefEdMulIdEntity ed2 = getEntityManager().find(SetRefEdMulIdEntity.class, ed2_id);
    SetRefIngMulIdEntity rev1 = getAuditReader().find(SetRefIngMulIdEntity.class, ing2_id, 1);
    SetRefIngMulIdEntity rev2 = getAuditReader().find(SetRefIngMulIdEntity.class, ing2_id, 2);
    SetRefIngMulIdEntity rev3 = getAuditReader().find(SetRefIngMulIdEntity.class, ing2_id, 3);
    assert rev1.getReference().equals(ed1);
    assert rev2.getReference().equals(ed1);
    assert rev3.getReference().equals(ed2);
}
Also used : SetRefEdMulIdEntity(org.hibernate.envers.test.entities.onetomany.ids.SetRefEdMulIdEntity) SetRefIngMulIdEntity(org.hibernate.envers.test.entities.onetomany.ids.SetRefIngMulIdEntity) Test(org.junit.Test)

Example 7 with SetRefEdMulIdEntity

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

the class BasicSetWithMulId method testHistoryOfEdIng1.

@Test
public void testHistoryOfEdIng1() {
    SetRefEdMulIdEntity ed1 = getEntityManager().find(SetRefEdMulIdEntity.class, ed1_id);
    SetRefEdMulIdEntity ed2 = getEntityManager().find(SetRefEdMulIdEntity.class, ed2_id);
    SetRefIngMulIdEntity rev1 = getAuditReader().find(SetRefIngMulIdEntity.class, ing1_id, 1);
    SetRefIngMulIdEntity rev2 = getAuditReader().find(SetRefIngMulIdEntity.class, ing1_id, 2);
    SetRefIngMulIdEntity rev3 = getAuditReader().find(SetRefIngMulIdEntity.class, ing1_id, 3);
    assert rev1.getReference().equals(ed1);
    assert rev2.getReference().equals(ed2);
    assert rev3.getReference().equals(ed2);
}
Also used : SetRefEdMulIdEntity(org.hibernate.envers.test.entities.onetomany.ids.SetRefEdMulIdEntity) SetRefIngMulIdEntity(org.hibernate.envers.test.entities.onetomany.ids.SetRefIngMulIdEntity) Test(org.junit.Test)

Aggregations

SetRefEdMulIdEntity (org.hibernate.envers.test.entities.onetomany.ids.SetRefEdMulIdEntity)7 SetRefIngMulIdEntity (org.hibernate.envers.test.entities.onetomany.ids.SetRefIngMulIdEntity)7 Test (org.junit.Test)7 EntityManager (javax.persistence.EntityManager)2 Priority (org.hibernate.envers.test.Priority)2 MulId (org.hibernate.envers.test.entities.ids.MulId)2 HashSet (java.util.HashSet)1 Set (java.util.Set)1