use of org.hibernate.envers.query.criteria.internal.RevisionTypeAuditExpression in project hibernate-orm by hibernate.
the class CrossTypeRevisionChangesReaderImpl method findEntities.
@Override
@SuppressWarnings({ "unchecked" })
public List<Object> findEntities(Number revision, RevisionType revisionType) throws IllegalStateException, IllegalArgumentException {
final Set<Pair<String, Class>> entityTypes = findEntityTypes(revision);
final List<Object> result = new ArrayList<>();
for (Pair<String, Class> type : entityTypes) {
result.addAll(auditReaderImplementor.createQuery().forEntitiesModifiedAtRevision(type.getSecond(), type.getFirst(), revision).add(new RevisionTypeAuditExpression(null, revisionType, "=")).getResultList());
}
return result;
}
use of org.hibernate.envers.query.criteria.internal.RevisionTypeAuditExpression in project hibernate-orm by hibernate.
the class CrossTypeRevisionChangesReaderImpl method findEntitiesGroupByRevisionType.
@Override
@SuppressWarnings({ "unchecked" })
public Map<RevisionType, List<Object>> findEntitiesGroupByRevisionType(Number revision) throws IllegalStateException, IllegalArgumentException {
final Set<Pair<String, Class>> entityTypes = findEntityTypes(revision);
final Map<RevisionType, List<Object>> result = new HashMap<>();
for (RevisionType revisionType : RevisionType.values()) {
result.put(revisionType, new ArrayList<>());
for (Pair<String, Class> type : entityTypes) {
final List<Object> list = auditReaderImplementor.createQuery().forEntitiesModifiedAtRevision(type.getSecond(), type.getFirst(), revision).add(new RevisionTypeAuditExpression(null, revisionType, "=")).getResultList();
result.get(revisionType).addAll(list);
}
}
return result;
}
Aggregations