Search in sources :

Example 11 with SetRefIngEmbIdEntity

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

the class BasicSetWithEmbId method testHistoryOfEdId1.

@Test
public void testHistoryOfEdId1() {
    SetRefIngEmbIdEntity ing1 = getEntityManager().find(SetRefIngEmbIdEntity.class, ing1_id);
    SetRefIngEmbIdEntity ing2 = getEntityManager().find(SetRefIngEmbIdEntity.class, ing2_id);
    SetRefEdEmbIdEntity rev1 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed1_id, 1);
    SetRefEdEmbIdEntity rev2 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed1_id, 2);
    SetRefEdEmbIdEntity rev3 = getAuditReader().find(SetRefEdEmbIdEntity.class, ed1_id, 3);
    assert rev1.getReffering().equals(makeSet(ing1, ing2));
    assert rev2.getReffering().equals(makeSet(ing2));
    assert rev3.getReffering().equals(Collections.EMPTY_SET);
}
Also used : SetRefIngEmbIdEntity(org.hibernate.envers.test.entities.onetomany.ids.SetRefIngEmbIdEntity) SetRefEdEmbIdEntity(org.hibernate.envers.test.entities.onetomany.ids.SetRefEdEmbIdEntity) Test(org.junit.Test)

Aggregations

SetRefIngEmbIdEntity (org.hibernate.envers.test.entities.onetomany.ids.SetRefIngEmbIdEntity)11 Test (org.junit.Test)11 SetRefEdEmbIdEntity (org.hibernate.envers.test.entities.onetomany.ids.SetRefEdEmbIdEntity)7 EntityManager (javax.persistence.EntityManager)3 Priority (org.hibernate.envers.test.Priority)3 HashSet (java.util.HashSet)2 List (java.util.List)2 Set (java.util.Set)2 EmbId (org.hibernate.envers.test.entities.ids.EmbId)2 StrIntTestEntity (org.hibernate.envers.test.entities.StrIntTestEntity)1 CollectionRefEdEntity (org.hibernate.envers.test.entities.onetomany.CollectionRefEdEntity)1 CollectionRefIngEntity (org.hibernate.envers.test.entities.onetomany.CollectionRefIngEntity)1