HHH-5580 - Renaming EntitiesChangedInRevisionManager to CrossTypeRevisionChangesReader
This commit is contained in:
parent
587c228973
commit
1f0149378b
|
@ -800,9 +800,9 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]></programlist
|
||||||
The basic query allows retrieving entity names and corresponding Java classes changed in a specified revision:
|
The basic query allows retrieving entity names and corresponding Java classes changed in a specified revision:
|
||||||
</para>
|
</para>
|
||||||
<programlisting><![CDATA[Set<Pair<String, Class>> modifiedEntityTypes = getAuditReader()
|
<programlisting><![CDATA[Set<Pair<String, Class>> modifiedEntityTypes = getAuditReader()
|
||||||
.getEntitiesChangedInRevisionManager().findEntityTypes(revisionNumber);]]></programlisting>
|
.getCrossTypeRevisionChangesReader().findEntityTypes(revisionNumber);]]></programlisting>
|
||||||
<para>
|
<para>
|
||||||
Other queries (also accessible from <interfacename>org.hibernate.envers.EntitiesChangedInRevisionManager</interfacename>):
|
Other queries (also accessible from <interfacename>org.hibernate.envers.CrossTypeRevisionChangesReader</interfacename>):
|
||||||
</para>
|
</para>
|
||||||
<orderedlist>
|
<orderedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
|
|
@ -211,7 +211,7 @@ public interface AuditReader {
|
||||||
throws HibernateException;
|
throws HibernateException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Basic implementation of {@link EntitiesChangedInRevisionManager} interface. Raises an exception if the default
|
* @return Basic implementation of {@link CrossTypeRevisionChangesReader} interface. Raises an exception if the default
|
||||||
* mechanism of tracking entity names modified during revisions has not been enabled.
|
* mechanism of tracking entity names modified during revisions has not been enabled.
|
||||||
* @throws AuditException If none of the following conditions is satisfied:
|
* @throws AuditException If none of the following conditions is satisfied:
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -223,5 +223,5 @@ public interface AuditReader {
|
||||||
* marked with {@link ModifiedEntityNames} interface.</li>
|
* marked with {@link ModifiedEntityNames} interface.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public EntitiesChangedInRevisionManager getEntitiesChangedInRevisionManager() throws AuditException;
|
public CrossTypeRevisionChangesReader getCrossTypeRevisionChangesReader() throws AuditException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.Set;
|
||||||
* is enabled.
|
* is enabled.
|
||||||
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
|
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
|
||||||
*/
|
*/
|
||||||
public interface EntitiesChangedInRevisionManager {
|
public interface CrossTypeRevisionChangesReader {
|
||||||
/**
|
/**
|
||||||
* Find all entities changed (added, updated and removed) in a given revision. Executes <i>n+1</i> SQL queries,
|
* Find all entities changed (added, updated and removed) in a given revision. Executes <i>n+1</i> SQL queries,
|
||||||
* where <i>n</i> is a number of different entity classes modified within specified revision.
|
* where <i>n</i> is a number of different entity classes modified within specified revision.
|
|
@ -37,7 +37,7 @@ import org.hibernate.HibernateException;
|
||||||
import org.hibernate.NonUniqueResultException;
|
import org.hibernate.NonUniqueResultException;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.engine.spi.SessionImplementor;
|
import org.hibernate.engine.spi.SessionImplementor;
|
||||||
import org.hibernate.envers.EntitiesChangedInRevisionManager;
|
import org.hibernate.envers.CrossTypeRevisionChangesReader;
|
||||||
import org.hibernate.envers.configuration.AuditConfiguration;
|
import org.hibernate.envers.configuration.AuditConfiguration;
|
||||||
import org.hibernate.envers.exception.AuditException;
|
import org.hibernate.envers.exception.AuditException;
|
||||||
import org.hibernate.envers.exception.NotAuditedException;
|
import org.hibernate.envers.exception.NotAuditedException;
|
||||||
|
@ -58,7 +58,7 @@ public class AuditReaderImpl implements AuditReaderImplementor {
|
||||||
private final SessionImplementor sessionImplementor;
|
private final SessionImplementor sessionImplementor;
|
||||||
private final Session session;
|
private final Session session;
|
||||||
private final FirstLevelCache firstLevelCache;
|
private final FirstLevelCache firstLevelCache;
|
||||||
private final EntitiesChangedInRevisionManager entitiesChangedInRevisionManager;
|
private final CrossTypeRevisionChangesReader crossTypeRevisionChangesReader;
|
||||||
|
|
||||||
public AuditReaderImpl(AuditConfiguration verCfg, Session session,
|
public AuditReaderImpl(AuditConfiguration verCfg, Session session,
|
||||||
SessionImplementor sessionImplementor) {
|
SessionImplementor sessionImplementor) {
|
||||||
|
@ -67,7 +67,7 @@ public class AuditReaderImpl implements AuditReaderImplementor {
|
||||||
this.session = session;
|
this.session = session;
|
||||||
|
|
||||||
firstLevelCache = new FirstLevelCache();
|
firstLevelCache = new FirstLevelCache();
|
||||||
entitiesChangedInRevisionManager = new EntitiesChangedInRevisionManagerImpl(this, verCfg);
|
crossTypeRevisionChangesReader = new CrossTypeRevisionChangesReaderImpl(this, verCfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkSession() {
|
private void checkSession() {
|
||||||
|
@ -244,13 +244,13 @@ public class AuditReaderImpl implements AuditReaderImplementor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntitiesChangedInRevisionManager getEntitiesChangedInRevisionManager() throws AuditException {
|
public CrossTypeRevisionChangesReader getCrossTypeRevisionChangesReader() throws AuditException {
|
||||||
if (!verCfg.getGlobalCfg().isTrackEntitiesChangedInRevisionEnabled()) {
|
if (!verCfg.getGlobalCfg().isTrackEntitiesChangedInRevisionEnabled()) {
|
||||||
throw new AuditException("This API is designed for Envers default mechanism of tracking entities modified in a given revision."
|
throw new AuditException("This API is designed for Envers default mechanism of tracking entities modified in a given revision."
|
||||||
+ " Extend DefaultTrackingModifiedEntitiesRevisionEntity, utilize @ModifiedEntityNames annotation or set "
|
+ " Extend DefaultTrackingModifiedEntitiesRevisionEntity, utilize @ModifiedEntityNames annotation or set "
|
||||||
+ "'org.hibernate.envers.track_entities_changed_in_revision' parameter to true.");
|
+ "'org.hibernate.envers.track_entities_changed_in_revision' parameter to true.");
|
||||||
}
|
}
|
||||||
return entitiesChangedInRevisionManager;
|
return crossTypeRevisionChangesReader;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked"})
|
@SuppressWarnings({"unchecked"})
|
||||||
|
|
|
@ -3,7 +3,7 @@ package org.hibernate.envers.reader;
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.engine.spi.SessionImplementor;
|
import org.hibernate.engine.spi.SessionImplementor;
|
||||||
import org.hibernate.envers.EntitiesChangedInRevisionManager;
|
import org.hibernate.envers.CrossTypeRevisionChangesReader;
|
||||||
import org.hibernate.envers.RevisionType;
|
import org.hibernate.envers.RevisionType;
|
||||||
import org.hibernate.envers.configuration.AuditConfiguration;
|
import org.hibernate.envers.configuration.AuditConfiguration;
|
||||||
import org.hibernate.envers.query.criteria.RevisionTypeAuditExpression;
|
import org.hibernate.envers.query.criteria.RevisionTypeAuditExpression;
|
||||||
|
@ -18,11 +18,11 @@ import static org.hibernate.envers.tools.ArgumentsTools.checkPositive;
|
||||||
/**
|
/**
|
||||||
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
|
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
|
||||||
*/
|
*/
|
||||||
public class EntitiesChangedInRevisionManagerImpl implements EntitiesChangedInRevisionManager {
|
public class CrossTypeRevisionChangesReaderImpl implements CrossTypeRevisionChangesReader {
|
||||||
private final AuditReaderImplementor auditReaderImplementor;
|
private final AuditReaderImplementor auditReaderImplementor;
|
||||||
private final AuditConfiguration verCfg;
|
private final AuditConfiguration verCfg;
|
||||||
|
|
||||||
public EntitiesChangedInRevisionManagerImpl(AuditReaderImplementor auditReaderImplementor, AuditConfiguration verCfg) {
|
public CrossTypeRevisionChangesReaderImpl(AuditReaderImplementor auditReaderImplementor, AuditConfiguration verCfg) {
|
||||||
this.auditReaderImplementor = auditReaderImplementor;
|
this.auditReaderImplementor = auditReaderImplementor;
|
||||||
this.verCfg = verCfg;
|
this.verCfg = verCfg;
|
||||||
}
|
}
|
|
@ -100,6 +100,6 @@ public class CustomTrackingEntitiesTest extends AbstractEntityTest {
|
||||||
|
|
||||||
@Test(expected = AuditException.class)
|
@Test(expected = AuditException.class)
|
||||||
public void testFindEntitiesChangedInRevisionException() {
|
public void testFindEntitiesChangedInRevisionException() {
|
||||||
getAuditReader().getEntitiesChangedInRevisionManager();
|
getAuditReader().getCrossTypeRevisionChangesReader();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package org.hibernate.envers.test.integration.reventity.trackmodifiedentities;
|
package org.hibernate.envers.test.integration.reventity.trackmodifiedentities;
|
||||||
|
|
||||||
import org.hibernate.ejb.Ejb3Configuration;
|
import org.hibernate.ejb.Ejb3Configuration;
|
||||||
import org.hibernate.envers.EntitiesChangedInRevisionManager;
|
import org.hibernate.envers.CrossTypeRevisionChangesReader;
|
||||||
import org.hibernate.envers.RevisionType;
|
import org.hibernate.envers.RevisionType;
|
||||||
import org.hibernate.envers.test.AbstractEntityTest;
|
import org.hibernate.envers.test.AbstractEntityTest;
|
||||||
import org.hibernate.envers.test.Priority;
|
import org.hibernate.envers.test.Priority;
|
||||||
|
@ -85,14 +85,14 @@ public class DefaultTrackingEntitiesTest extends AbstractEntityTest {
|
||||||
StrTestEntity ste = new StrTestEntity("x", steId);
|
StrTestEntity ste = new StrTestEntity("x", steId);
|
||||||
StrIntTestEntity site = new StrIntTestEntity("y", 1, siteId);
|
StrIntTestEntity site = new StrIntTestEntity("y", 1, siteId);
|
||||||
|
|
||||||
assert TestTools.checkList(getEntitiesChangedInRevisionManager().findEntities(1), ste, site);
|
assert TestTools.checkList(getCrossTypeRevisionChangesReader().findEntities(1), ste, site);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTrackModifiedEntities() {
|
public void testTrackModifiedEntities() {
|
||||||
StrIntTestEntity site = new StrIntTestEntity("y", 2, siteId);
|
StrIntTestEntity site = new StrIntTestEntity("y", 2, siteId);
|
||||||
|
|
||||||
assert TestTools.checkList(getEntitiesChangedInRevisionManager().findEntities(2), site);
|
assert TestTools.checkList(getCrossTypeRevisionChangesReader().findEntities(2), site);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -100,12 +100,12 @@ public class DefaultTrackingEntitiesTest extends AbstractEntityTest {
|
||||||
StrTestEntity ste = new StrTestEntity(null, steId);
|
StrTestEntity ste = new StrTestEntity(null, steId);
|
||||||
StrIntTestEntity site = new StrIntTestEntity(null, null, siteId);
|
StrIntTestEntity site = new StrIntTestEntity(null, null, siteId);
|
||||||
|
|
||||||
assert TestTools.checkList(getEntitiesChangedInRevisionManager().findEntities(3), site, ste);
|
assert TestTools.checkList(getCrossTypeRevisionChangesReader().findEntities(3), site, ste);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFindChangesInInvalidRevision() {
|
public void testFindChangesInInvalidRevision() {
|
||||||
assert getEntitiesChangedInRevisionManager().findEntities(4).isEmpty();
|
assert getCrossTypeRevisionChangesReader().findEntities(4).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -113,7 +113,7 @@ public class DefaultTrackingEntitiesTest extends AbstractEntityTest {
|
||||||
StrTestEntity ste = new StrTestEntity("x", steId);
|
StrTestEntity ste = new StrTestEntity("x", steId);
|
||||||
StrIntTestEntity site = new StrIntTestEntity("y", 1, siteId);
|
StrIntTestEntity site = new StrIntTestEntity("y", 1, siteId);
|
||||||
|
|
||||||
Map<RevisionType, List<Object>> result = getEntitiesChangedInRevisionManager().findEntitiesGroupByRevisionType(1);
|
Map<RevisionType, List<Object>> result = getCrossTypeRevisionChangesReader().findEntitiesGroupByRevisionType(1);
|
||||||
assert TestTools.checkList(result.get(RevisionType.ADD), site, ste);
|
assert TestTools.checkList(result.get(RevisionType.ADD), site, ste);
|
||||||
assert TestTools.checkList(result.get(RevisionType.MOD));
|
assert TestTools.checkList(result.get(RevisionType.MOD));
|
||||||
assert TestTools.checkList(result.get(RevisionType.DEL));
|
assert TestTools.checkList(result.get(RevisionType.DEL));
|
||||||
|
@ -123,7 +123,7 @@ public class DefaultTrackingEntitiesTest extends AbstractEntityTest {
|
||||||
public void testTrackModifiedEntitiesGroupByRevisionType() {
|
public void testTrackModifiedEntitiesGroupByRevisionType() {
|
||||||
StrIntTestEntity site = new StrIntTestEntity("y", 2, siteId);
|
StrIntTestEntity site = new StrIntTestEntity("y", 2, siteId);
|
||||||
|
|
||||||
Map<RevisionType, List<Object>> result = getEntitiesChangedInRevisionManager().findEntitiesGroupByRevisionType(2);
|
Map<RevisionType, List<Object>> result = getCrossTypeRevisionChangesReader().findEntitiesGroupByRevisionType(2);
|
||||||
assert TestTools.checkList(result.get(RevisionType.ADD));
|
assert TestTools.checkList(result.get(RevisionType.ADD));
|
||||||
assert TestTools.checkList(result.get(RevisionType.MOD), site);
|
assert TestTools.checkList(result.get(RevisionType.MOD), site);
|
||||||
assert TestTools.checkList(result.get(RevisionType.DEL));
|
assert TestTools.checkList(result.get(RevisionType.DEL));
|
||||||
|
@ -134,7 +134,7 @@ public class DefaultTrackingEntitiesTest extends AbstractEntityTest {
|
||||||
StrTestEntity ste = new StrTestEntity(null, steId);
|
StrTestEntity ste = new StrTestEntity(null, steId);
|
||||||
StrIntTestEntity site = new StrIntTestEntity(null, null, siteId);
|
StrIntTestEntity site = new StrIntTestEntity(null, null, siteId);
|
||||||
|
|
||||||
Map<RevisionType, List<Object>> result = getEntitiesChangedInRevisionManager().findEntitiesGroupByRevisionType(3);
|
Map<RevisionType, List<Object>> result = getCrossTypeRevisionChangesReader().findEntitiesGroupByRevisionType(3);
|
||||||
assert TestTools.checkList(result.get(RevisionType.ADD));
|
assert TestTools.checkList(result.get(RevisionType.ADD));
|
||||||
assert TestTools.checkList(result.get(RevisionType.MOD));
|
assert TestTools.checkList(result.get(RevisionType.MOD));
|
||||||
assert TestTools.checkList(result.get(RevisionType.DEL), site, ste);
|
assert TestTools.checkList(result.get(RevisionType.DEL), site, ste);
|
||||||
|
@ -145,14 +145,14 @@ public class DefaultTrackingEntitiesTest extends AbstractEntityTest {
|
||||||
StrTestEntity ste = new StrTestEntity("x", steId);
|
StrTestEntity ste = new StrTestEntity("x", steId);
|
||||||
StrIntTestEntity site = new StrIntTestEntity("y", 1, siteId);
|
StrIntTestEntity site = new StrIntTestEntity("y", 1, siteId);
|
||||||
|
|
||||||
assert TestTools.checkList(getEntitiesChangedInRevisionManager().findEntities(1, RevisionType.ADD), ste, site);
|
assert TestTools.checkList(getCrossTypeRevisionChangesReader().findEntities(1, RevisionType.ADD), ste, site);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFindChangedEntitiesByRevisionTypeMOD() {
|
public void testFindChangedEntitiesByRevisionTypeMOD() {
|
||||||
StrIntTestEntity site = new StrIntTestEntity("y", 2, siteId);
|
StrIntTestEntity site = new StrIntTestEntity("y", 2, siteId);
|
||||||
|
|
||||||
assert TestTools.checkList(getEntitiesChangedInRevisionManager().findEntities(2, RevisionType.MOD), site);
|
assert TestTools.checkList(getCrossTypeRevisionChangesReader().findEntities(2, RevisionType.MOD), site);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -160,24 +160,24 @@ public class DefaultTrackingEntitiesTest extends AbstractEntityTest {
|
||||||
StrTestEntity ste = new StrTestEntity(null, steId);
|
StrTestEntity ste = new StrTestEntity(null, steId);
|
||||||
StrIntTestEntity site = new StrIntTestEntity(null, null, siteId);
|
StrIntTestEntity site = new StrIntTestEntity(null, null, siteId);
|
||||||
|
|
||||||
assert TestTools.checkList(getEntitiesChangedInRevisionManager().findEntities(3, RevisionType.DEL), ste, site);
|
assert TestTools.checkList(getCrossTypeRevisionChangesReader().findEntities(3, RevisionType.DEL), ste, site);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFindEntityTypesChangedInRevision() {
|
public void testFindEntityTypesChangedInRevision() {
|
||||||
assert TestTools.makeSet(Pair.make(StrTestEntity.class.getName(), StrTestEntity.class),
|
assert TestTools.makeSet(Pair.make(StrTestEntity.class.getName(), StrTestEntity.class),
|
||||||
Pair.make(StrIntTestEntity.class.getName(), StrIntTestEntity.class))
|
Pair.make(StrIntTestEntity.class.getName(), StrIntTestEntity.class))
|
||||||
.equals(getEntitiesChangedInRevisionManager().findEntityTypes(1));
|
.equals(getCrossTypeRevisionChangesReader().findEntityTypes(1));
|
||||||
|
|
||||||
assert TestTools.makeSet(Pair.make(StrIntTestEntity.class.getName(), StrIntTestEntity.class))
|
assert TestTools.makeSet(Pair.make(StrIntTestEntity.class.getName(), StrIntTestEntity.class))
|
||||||
.equals(getEntitiesChangedInRevisionManager().findEntityTypes(2));
|
.equals(getCrossTypeRevisionChangesReader().findEntityTypes(2));
|
||||||
|
|
||||||
assert TestTools.makeSet(Pair.make(StrTestEntity.class.getName(), StrTestEntity.class),
|
assert TestTools.makeSet(Pair.make(StrTestEntity.class.getName(), StrTestEntity.class),
|
||||||
Pair.make(StrIntTestEntity.class.getName(), StrIntTestEntity.class))
|
Pair.make(StrIntTestEntity.class.getName(), StrIntTestEntity.class))
|
||||||
.equals(getEntitiesChangedInRevisionManager().findEntityTypes(3));
|
.equals(getCrossTypeRevisionChangesReader().findEntityTypes(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntitiesChangedInRevisionManager getEntitiesChangedInRevisionManager() {
|
private CrossTypeRevisionChangesReader getCrossTypeRevisionChangesReader() {
|
||||||
return getAuditReader().getEntitiesChangedInRevisionManager();
|
return getAuditReader().getCrossTypeRevisionChangesReader();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,9 +64,9 @@ public class EntityNamesTest extends AbstractSessionTest {
|
||||||
public void testModifiedEntityTypes() {
|
public void testModifiedEntityTypes() {
|
||||||
assert TestTools.makeSet(Pair.make(Car.class.getName(), Car.class),
|
assert TestTools.makeSet(Pair.make(Car.class.getName(), Car.class),
|
||||||
Pair.make("Personaje", Person.class))
|
Pair.make("Personaje", Person.class))
|
||||||
.equals(getAuditReader().getEntitiesChangedInRevisionManager().findEntityTypes(1));
|
.equals(getAuditReader().getCrossTypeRevisionChangesReader().findEntityTypes(1));
|
||||||
assert TestTools.makeSet(Pair.make(Car.class.getName(), Car.class),
|
assert TestTools.makeSet(Pair.make(Car.class.getName(), Car.class),
|
||||||
Pair.make("Personaje", Person.class))
|
Pair.make("Personaje", Person.class))
|
||||||
.equals(getAuditReader().getEntitiesChangedInRevisionManager().findEntityTypes(2));
|
.equals(getAuditReader().getCrossTypeRevisionChangesReader().findEntityTypes(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
package org.hibernate.envers.test.integration.reventity.trackmodifiedentities;
|
package org.hibernate.envers.test.integration.reventity.trackmodifiedentities;
|
||||||
|
|
||||||
import org.hibernate.ejb.Ejb3Configuration;
|
import org.hibernate.ejb.Ejb3Configuration;
|
||||||
import org.hibernate.envers.EntitiesChangedInRevisionManager;
|
import org.hibernate.envers.CrossTypeRevisionChangesReader;
|
||||||
import org.hibernate.envers.test.AbstractEntityTest;
|
import org.hibernate.envers.test.AbstractEntityTest;
|
||||||
import org.hibernate.envers.test.Priority;
|
import org.hibernate.envers.test.Priority;
|
||||||
import org.hibernate.envers.test.entities.StrTestEntity;
|
import org.hibernate.envers.test.entities.StrTestEntity;
|
||||||
|
@ -60,7 +60,7 @@ public class TrackingEntitiesMultipleChangesTest extends AbstractEntityTest {
|
||||||
StrTestEntity ste1 = new StrTestEntity("x", steId1);
|
StrTestEntity ste1 = new StrTestEntity("x", steId1);
|
||||||
StrTestEntity ste2 = new StrTestEntity("y", steId2);
|
StrTestEntity ste2 = new StrTestEntity("y", steId2);
|
||||||
|
|
||||||
assert Arrays.asList(ste1, ste2).equals(getEntitiesChangedInRevisionManager().findEntities(1));
|
assert Arrays.asList(ste1, ste2).equals(getCrossTypeRevisionChangesReader().findEntities(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -68,17 +68,17 @@ public class TrackingEntitiesMultipleChangesTest extends AbstractEntityTest {
|
||||||
StrTestEntity ste1 = new StrTestEntity("z", steId1);
|
StrTestEntity ste1 = new StrTestEntity("z", steId1);
|
||||||
StrTestEntity ste2 = new StrTestEntity(null, steId2);
|
StrTestEntity ste2 = new StrTestEntity(null, steId2);
|
||||||
|
|
||||||
assert Arrays.asList(ste1, ste2).equals(getEntitiesChangedInRevisionManager().findEntities(2));
|
assert Arrays.asList(ste1, ste2).equals(getCrossTypeRevisionChangesReader().findEntities(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTrackUpdateAndRemoveTheSameEntity() {
|
public void testTrackUpdateAndRemoveTheSameEntity() {
|
||||||
StrTestEntity ste1 = new StrTestEntity(null, steId1);
|
StrTestEntity ste1 = new StrTestEntity(null, steId1);
|
||||||
|
|
||||||
assert Arrays.asList(ste1).equals(getEntitiesChangedInRevisionManager().findEntities(3));
|
assert Arrays.asList(ste1).equals(getCrossTypeRevisionChangesReader().findEntities(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
private EntitiesChangedInRevisionManager getEntitiesChangedInRevisionManager() {
|
private CrossTypeRevisionChangesReader getCrossTypeRevisionChangesReader() {
|
||||||
return getAuditReader().getEntitiesChangedInRevisionManager();
|
return getAuditReader().getCrossTypeRevisionChangesReader();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue