Until there is an official fix, looks like you can work around the issue by projecting on the revision number first, then fetching the revision entities manually. Something like this:
@SuppressWarnings("unchecked")
List<Number> revisionNumbers = auditReader.createQuery().forRevisionsOfEntity(YourEntity.class, true, true)
// add your criteria here
.addProjection(AuditEntity.revisionNumber().distinct())
.getResultList();
Map<Number, YourRevision> revisions = auditReader.findRevisions(YourRevision.class, new HashSet<Number>(revisionNumbers));
Interestingly, it also works with selectEntitiesOnly=false, but it generates a useless join into the query in that case.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
Until there is an official fix, looks like you can work around the issue by projecting on the revision number first, then fetching the revision entities manually. Something like this:
@SuppressWarnings("unchecked")
List<Number> revisionNumbers = auditReader.createQuery().forRevisionsOfEntity(YourEntity.class, true, true)
// add your criteria here
.addProjection(AuditEntity.revisionNumber().distinct())
.getResultList();
Map<Number, YourRevision> revisions = auditReader.findRevisions(YourRevision.class, new HashSet<Number>(revisionNumbers));
Interestingly, it also works with selectEntitiesOnly=false, but it generates a useless join into the query in that case.