Search in sources :

Example 36 with StrIntTestEntity

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

the class StoreDeletedData method testRevisionsPropertyEqQuery.

@Test
public void testRevisionsPropertyEqQuery() {
    List revs_id1 = getAuditReader().createQuery().forRevisionsOfEntity(StrIntTestEntity.class, false, true).add(AuditEntity.id().eq(id1)).getResultList();
    Assert.assertEquals(2, revs_id1.size());
    Assert.assertEquals(new StrIntTestEntity("a", 10, id1), ((Object[]) revs_id1.get(0))[0]);
    Assert.assertEquals(new StrIntTestEntity("a", 10, id1), ((Object[]) revs_id1.get(1))[0]);
}
Also used : StrIntTestEntity(org.hibernate.envers.test.entities.StrIntTestEntity) List(java.util.List) Test(org.junit.Test)

Aggregations

StrIntTestEntity (org.hibernate.envers.test.entities.StrIntTestEntity)36 Test (org.junit.Test)36 List (java.util.List)14 EntityManager (javax.persistence.EntityManager)12 Priority (org.hibernate.envers.test.Priority)12 StrTestEntity (org.hibernate.envers.test.entities.StrTestEntity)8 TestForIssue (org.hibernate.testing.TestForIssue)7 RevisionType (org.hibernate.envers.RevisionType)6 HashSet (java.util.HashSet)3 AuditDisjunction (org.hibernate.envers.query.criteria.AuditDisjunction)2 AuditCriterion (org.hibernate.envers.query.criteria.AuditCriterion)1 EmbId (org.hibernate.envers.test.entities.ids.EmbId)1 EmbIdTestEntity (org.hibernate.envers.test.entities.ids.EmbIdTestEntity)1 MulId (org.hibernate.envers.test.entities.ids.MulId)1 MulIdTestEntity (org.hibernate.envers.test.entities.ids.MulIdTestEntity)1 CollectionRefEdEntity (org.hibernate.envers.test.entities.onetomany.CollectionRefEdEntity)1 CollectionRefIngEntity (org.hibernate.envers.test.entities.onetomany.CollectionRefIngEntity)1 SetRefIngEmbIdEntity (org.hibernate.envers.test.entities.onetomany.ids.SetRefIngEmbIdEntity)1