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 46b9e55 commit c4b1c18
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,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 c4b1c18

Please # to comment.