diff --git a/src/main/java/org/tkit/onecx/theme/domain/daos/ThemeDAO.java b/src/main/java/org/tkit/onecx/theme/domain/daos/ThemeDAO.java index ba91b6b..ac45ce5 100644 --- a/src/main/java/org/tkit/onecx/theme/domain/daos/ThemeDAO.java +++ b/src/main/java/org/tkit/onecx/theme/domain/daos/ThemeDAO.java @@ -90,6 +90,7 @@ public PageResult findThemesByCriteria(ThemeSearchCriteria criteria) { if (criteria.getName() != null && !criteria.getName().isBlank()) { cq.where(cb.like(root.get(Theme_.name), QueryCriteriaUtil.wildcard(criteria.getName()))); } + cq.orderBy(cb.desc(root.get(TraceableEntity_.CREATION_DATE))); return createPageQuery(cq, Page.of(criteria.getPageNumber(), criteria.getPageSize())).getPageResult(); } catch (Exception ex) { @@ -101,7 +102,8 @@ public PageResult findAll(Integer pageNumber, Integer pageSize) { try { var cb = this.getEntityManager().getCriteriaBuilder(); var cq = cb.createQuery(Theme.class); - cq.from(Theme.class); + var root = cq.from(Theme.class); + cq.orderBy(cb.desc(root.get(TraceableEntity_.CREATION_DATE))); return createPageQuery(cq, Page.of(pageNumber, pageSize)).getPageResult(); } catch (Exception ex) { throw new DAOException(ErrorKeys.ERROR_FIND_ALL_THEME_PAGE, ex); diff --git a/src/main/openapi/onecx-theme-internal-openapi.yaml b/src/main/openapi/onecx-theme-internal-openapi.yaml index e4e6fd8..cd9fc46 100644 --- a/src/main/openapi/onecx-theme-internal-openapi.yaml +++ b/src/main/openapi/onecx-theme-internal-openapi.yaml @@ -203,7 +203,8 @@ components: pageSize: format: int32 description: The size of page - default: 10 + default: 100 + maximum: 1000 type: integer ThemeInfoList: type: object