Skip to content

Commit fc7a7c8

Browse files
committed
fix: Use name instead of id
It is preferable to sort the Name field because it is a field known to the user, who can therefore visualize the sorting logic.The name is indexed in the flow table, so it has no impact on performance.
1 parent e082b06 commit fc7a7c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/it/gov/pagopa/fdr/repository/FlowRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ public RepositoryPagedResult<FlowEntity> findLatestPublishedByOrganizationIdAndO
258258
String queryString = String.join(AND, queryBuilder);
259259

260260
Page page = Page.of(pageNumber - 1, pageSize);
261-
// Sorting by ID ensures that the sorting is deterministic in cases where multiple records have the same date.
262-
Sort sort = getSort(SortField.of("date", Direction.Ascending), SortField.of("id", Direction.Ascending));
261+
// Sorting by name ensures that the sorting is deterministic in cases where multiple records have the same date.
262+
Sort sort = getSort(SortField.of("date", Direction.Ascending), SortField.of("name", Direction.Ascending));
263263

264264
PanacheQuery<FlowEntity> resultPage =
265265
FlowEntity.findPageByQuery(queryString, sort, parameters).page(page);

0 commit comments

Comments
 (0)