Skip to content

Commit

Permalink
Fixed sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Hui committed Jun 6, 2023
1 parent 96e4394 commit 9bef470
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -892,13 +892,15 @@ private List<EbeanMetadataAspect> batchGetUnion(@Nonnull List<AspectKey<URN, ? e
}
}

sb.append(" ORDER BY createdOn DESC");

final Query<EbeanMetadataAspect> query = _server.findNative(EbeanMetadataAspect.class, sb.toString());

for (int i = 1; i <= params.size(); i++) {
query.setParameter(i, params.get(i - 1));
}

return query.orderBy().desc(CREATED_ON_COLUMN).findList();
return query.findList();
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3112,6 +3112,7 @@ public void testDuplicityOrdering() {

// when retrieving a v0-duplicate record, the returned value should be the LATEST (timestamp=1234L)
AspectFoo actual = dao.get(AspectFoo.class, urn).get();
System.out.println(actual);
assertEquals(actual, v1);
}
}
Expand Down

0 comments on commit 9bef470

Please sign in to comment.