Skip to content

Commit 9d53575

Browse files
committed
add SortRepository
1 parent b872ea0 commit 9d53575

File tree

1 file changed

+5
-3
lines changed
  • springboot-starter-data-fast/src/main/java/com/codingapi/springboot/fast/jpa/repository

1 file changed

+5
-3
lines changed

springboot-starter-data-fast/src/main/java/com/codingapi/springboot/fast/jpa/repository/SortRepository.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ default void reSort(SortRequest request) {
1919
for (Object objectId : request.getIds()) {
2020
ID id = (ID) objectId;
2121
T t = getReferenceById(id);
22-
if (t.getSort() != null && t.getSort() < minSort) {
23-
minSort = t.getSort();
24-
}else{
22+
if (t.getSort() == null) {
2523
minSort = 0;
24+
} else {
25+
if (t.getSort() < minSort) {
26+
minSort = t.getSort();
27+
}
2628
}
2729
list.add(t);
2830
}

0 commit comments

Comments
 (0)