From 875a4b29dd7c93952eb82f78e9876b78f2b4c16b Mon Sep 17 00:00:00 2001 From: Michael Rudolf Date: Wed, 4 Jan 2012 17:06:26 +0100 Subject: [PATCH] HHH-5891: Added ordering clause to query generated by getRevisions() to fulfill guarantee given in JavaDoc. --- .../main/java/org/hibernate/envers/reader/AuditReaderImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java b/hibernate-envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java index bf501064f8..c804594f4d 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/reader/AuditReaderImpl.java @@ -151,6 +151,7 @@ public class AuditReaderImpl implements AuditReaderImplementor { return createQuery().forRevisionsOfEntity(cls, entityName, false, true) .addProjection(AuditEntity.revisionNumber()) + .addOrder(AuditEntity.revisionNumber().asc()) .add(AuditEntity.id().eq(primaryKey)) .getResultList(); }