From 8de98da22f511dbb1506bafddfa2ff69907ca1db Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Fri, 18 Feb 2022 17:10:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=BE=D0=B4=20empty=20=D0=B2=20SortContainer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Он не нужен, проще отправлять null. Изменил метод проверки в CriteriaJooqFilter --- .../dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java | 3 +-- .../dev/struchkov/haiti/filter/jooq/sort/SortContainer.java | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java b/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java index 8737766..b82609e 100644 --- a/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java +++ b/src/main/java/dev/struchkov/haiti/filter/jooq/CriteriaJooqFilter.java @@ -111,8 +111,7 @@ public class CriteriaJooqFilter { } public CriteriaJooqFilter sort(SortContainer container) { - Assert.isNotNull(container); - if (container.getFieldName() != null) { + if (container != null && container.getFieldName() != null) { this.sorts.add(container); } return this; diff --git a/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java b/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java index 6bd1b7f..e1ce9f3 100644 --- a/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java +++ b/src/main/java/dev/struchkov/haiti/filter/jooq/sort/SortContainer.java @@ -17,10 +17,6 @@ public class SortContainer { this.type = type; } - public static SortContainer empty() { - return new SortContainer(null); - } - public static SortContainer of(String fieldName) { Assert.isNotNull(fieldName); return new SortContainer(fieldName);