use of org.hibernate.envers.test.entities.StrIntTestEntity in project hibernate-orm by hibernate.
the class DefaultTrackingEntitiesTest method testTrackAddedEntities.
@Test
public void testTrackAddedEntities() {
StrTestEntity ste = new StrTestEntity("x", steId);
StrIntTestEntity site = new StrIntTestEntity("y", 1, siteId);
assert TestTools.checkCollection(getCrossTypeRevisionChangesReader().findEntities(1), ste, site);
}
use of org.hibernate.envers.test.entities.StrIntTestEntity in project hibernate-orm by hibernate.
the class DefaultTrackingEntitiesTest method testTrackModifiedEntitiesGroupByRevisionType.
@Test
public void testTrackModifiedEntitiesGroupByRevisionType() {
StrIntTestEntity site = new StrIntTestEntity("y", 2, siteId);
Map<RevisionType, List<Object>> result = getCrossTypeRevisionChangesReader().findEntitiesGroupByRevisionType(2);
assert TestTools.checkCollection(result.get(RevisionType.ADD));
assert TestTools.checkCollection(result.get(RevisionType.MOD), site);
assert TestTools.checkCollection(result.get(RevisionType.DEL));
}
use of org.hibernate.envers.test.entities.StrIntTestEntity in project hibernate-orm by hibernate.
the class DefaultTrackingEntitiesTest method testTrackDeletedEntities.
@Test
public void testTrackDeletedEntities() {
StrTestEntity ste = new StrTestEntity(null, steId);
StrIntTestEntity site = new StrIntTestEntity(null, null, siteId);
assert TestTools.checkCollection(getCrossTypeRevisionChangesReader().findEntities(3), site, ste);
}
use of org.hibernate.envers.test.entities.StrIntTestEntity in project hibernate-orm by hibernate.
the class DefaultTrackingEntitiesTest method testTrackDeletedEntitiesGroupByRevisionType.
@Test
public void testTrackDeletedEntitiesGroupByRevisionType() {
StrTestEntity ste = new StrTestEntity(null, steId);
StrIntTestEntity site = new StrIntTestEntity(null, null, siteId);
Map<RevisionType, List<Object>> result = getCrossTypeRevisionChangesReader().findEntitiesGroupByRevisionType(3);
assert TestTools.checkCollection(result.get(RevisionType.ADD));
assert TestTools.checkCollection(result.get(RevisionType.MOD));
assert TestTools.checkCollection(result.get(RevisionType.DEL), site, ste);
}
use of org.hibernate.envers.test.entities.StrIntTestEntity in project hibernate-orm by hibernate.
the class NullPropertyQuery method initData.
@Test
@Priority(10)
public void initData() {
// Revision 1
EntityManager em = getEntityManager();
em.getTransaction().begin();
StrIntTestEntity nullSite = new StrIntTestEntity(null, 1);
StrIntTestEntity notNullSite = new StrIntTestEntity("data", 2);
em.persist(nullSite);
em.persist(notNullSite);
idSimplePropertyNull = nullSite.getId();
idSimplePropertyNotNull = notNullSite.getId();
em.getTransaction().commit();
// Revision 2
em.getTransaction().begin();
SetRefIngEmbIdEntity nullParentSrieie = new SetRefIngEmbIdEntity(idMulticolumnReferenceToParentNull, "data", null);
em.persist(nullParentSrieie);
em.getTransaction().commit();
// Revision 3
em.getTransaction().begin();
CollectionRefEdEntity parent = new CollectionRefEdEntity(idParent, "data");
CollectionRefIngEntity notNullParentCrie = new CollectionRefIngEntity(idReferenceToParentNotNull, "data", parent);
em.persist(parent);
em.persist(notNullParentCrie);
em.getTransaction().commit();
}
Aggregations