This content has been marked as final.
Show 2 replies
-
1. Re: Query for the last entries before specific revision
edoarsla Oct 8, 2014 10:17 PM (in response to edoarsla)Basically an equivalent of this:
SELECT c.* FROM ConfigProperty_AUD c
INNER JOIN
(SELECT id, REVTYPE, MAX(REV) as latest from ConfigProperty_AUD WHERE REV<=8 GROUP BY id ) c1
ON c1.id=c.id AND c1.latest=c.REV AND c.REVTYPE!=2
-
2. Re: Query for the last entries before specific revision
edoarsla Oct 9, 2014 3:23 PM (in response to edoarsla)I believe this solves it:
AuditQuery query = reader.createQuery().forRevisionsOfEntity(ConfigProperty.class, false, false);
query.add(AuditEntity.revisionNumber().maximize().add(AuditEntity.revisionNumber().le(rev)).computeAggregationInInstanceContext());