syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmarte...@apache.org
Subject [syncope] 02/04: [SYNCOPE-1412] changes in order to avoid null_attr views
Date Mon, 10 Dec 2018 14:39:15 GMT
This is an automated email from the ASF dual-hosted git repository.

fmartelli pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 497d6fcc03ffc304df58dfdfe93922d88fca275a
Author: fmartelli <fabio.martelli@gmail.com>
AuthorDate: Mon Dec 10 14:37:22 2018 +0100

    [SYNCOPE-1412] changes in order to avoid null_attr views
---
 .../syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
index 02e2535..942cc95 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
@@ -877,15 +877,17 @@ public class JPAAnySearchDAO extends AbstractAnySearchDAO {
         StringBuilder query = new StringBuilder("SELECT DISTINCT any_id FROM ");
         switch (cond.getType()) {
             case ISNOTNULL:
-                query.append(svs.field().name).
-                        append(" WHERE any_id NOT IN (SELECT any_id FROM ").
-                        append(svs.asSearchViewSupport().nullAttr().name).
-                        append(" WHERE schema_id='").append(checked.getLeft().getKey()).append("')");
+                query.append(svs.attr().name).append(" WHERE schema_id=").
+                        append("'").append(checked.getLeft().getKey()).append("'");
                 break;
 
             case ISNULL:
-                query.append(svs.asSearchViewSupport().nullAttr().name).
-                        append(" WHERE schema_id='").append(checked.getLeft().getKey()).append("'");
+                query.append(svs.field().name).
+                        append(" WHERE any_id NOT IN ").
+                        append("(").
+                        append("SELECT DISTINCT any_id FROM ").append(svs.attr().name).append("
WHERE schema_id=").
+                        append("'").append(checked.getLeft().getKey()).append("'").
+                        append(")");
                 break;
 
             default:


Mime
View raw message