diff --git a/src/main/java/com/xkrs/util/DataSourceQuery.java b/src/main/java/com/xkrs/util/DataSourceQuery.java index 18f5e4c..c982332 100644 --- a/src/main/java/com/xkrs/util/DataSourceQuery.java +++ b/src/main/java/com/xkrs/util/DataSourceQuery.java @@ -3,6 +3,7 @@ package com.xkrs.util; import com.xkrs.dao.DataSourceDao; import com.xkrs.model.entity.DataSource; import org.apache.http.util.TextUtils; +import org.springframework.data.domain.Sort; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Component; @@ -50,6 +51,6 @@ public class DataSourceQuery { Predicate[] predicates = new Predicate[list.size()]; return criteriaBuilder.and(list.toArray(predicates)); }; - return dataSourceDao.findAll(specification); + return dataSourceDao.findAll(specification, Sort.by(Sort.Direction.DESC, "id")); } }