Skip to content

Commit

Permalink
Sort revisions by timestamp and revision number.
Browse files Browse the repository at this point in the history
Sorting by revision number alone failed for distributed systems using batched sequences for revision numbers.

Closes #3643
See #3579
  • Loading branch information
schauder committed Oct 21, 2024
1 parent e27241e commit 4a02924
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public EnversRevisionRepositoryImpl(JpaEntityInformation<T, ?> entityInformation
public Optional<Revision<N, T>> findLastChangeRevision(ID id) {

List<Object[]> singleResult = createBaseQuery(id) //
.addOrder(AuditEntity.revisionProperty("timestamp").desc()) //
.addOrder(AuditEntity.revisionNumber().desc()) //
.setMaxResults(1) //
.getResultList();
Expand Down

0 comments on commit 4a02924

Please sign in to comment.