From ef729e5da8d562661e63ec62693cdc23f60b8b4c Mon Sep 17 00:00:00 2001 From: Vladislav Plakhov Date: Thu, 8 Oct 2020 14:56:05 +0400 Subject: [PATCH] Fix sorting by association attribute if the have null value #121 --- .../addon/restapi/api/service/EntitiesControllerManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rest-api/src/com/haulmont/addon/restapi/api/service/EntitiesControllerManager.java b/modules/rest-api/src/com/haulmont/addon/restapi/api/service/EntitiesControllerManager.java index 2547188..b4cb797 100644 --- a/modules/rest-api/src/com/haulmont/addon/restapi/api/service/EntitiesControllerManager.java +++ b/modules/rest-api/src/com/haulmont/addon/restapi/api/service/EntitiesControllerManager.java @@ -345,11 +345,11 @@ protected String addOrderBy(String queryString, @Nullable String sort, MetaClass if (propertyPath != null) { switch (order) { case "-": - order = " desc, "; + order = " desc NULLS LAST, "; break; case "+": default: - order = " asc, "; + order = " asc NULLS FIRST, "; break; } MetaProperty metaProperty = propertyPath.getMetaProperty();