syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject syncope git commit: [SYNCOPE-119] Another small fix for isAssignable queries
Date Wed, 25 Nov 2015 17:05:02 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 2ec09df55 -> ca2628647


[SYNCOPE-119] Another small fix for isAssignable queries


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/ca262864
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/ca262864
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/ca262864

Branch: refs/heads/master
Commit: ca262864747b56e38851a963f45b3a59e1d8592c
Parents: 2ec09df
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Wed Nov 25 18:04:55 2015 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Wed Nov 25 18:04:55 2015 +0100

----------------------------------------------------------------------
 .../apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java | 4 ++--
 .../java/org/apache/syncope/fit/core/reference/SearchITCase.java | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/ca262864/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnySearchDAO.java
----------------------------------------------------------------------
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 2c0139c..c0f57b0 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
@@ -644,11 +644,11 @@ public class JPAAnySearchDAO extends AbstractDAO<Any<?>, Long>
implements AnySea
         }
 
         StringBuilder query = new StringBuilder("SELECT DISTINCT any_id FROM ").
-                append(svs.field().name).append(" WHERE ");
+                append(svs.field().name).append(" WHERE (");
         for (Realm current = realm; current.getParent() != null; current = current.getParent())
{
             query.append("realm_id=?").append(setParameter(parameters, current.getKey())).append("
OR ");
         }
-        query.append("realm_id=?").append(setParameter(parameters, realmDAO.getRoot().getKey()));
+        query.append("realm_id=?").append(setParameter(parameters, realmDAO.getRoot().getKey())).append(')');
 
         return query.toString();
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/ca262864/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SearchITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SearchITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SearchITCase.java
index 7b07728..bd749e2 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SearchITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SearchITCase.java
@@ -345,7 +345,7 @@ public class SearchITCase extends AbstractITCase {
     @Test
     public void assignable() {
         PagedResult<GroupTO> groups = groupService.search(
-                new AnySearchQuery.Builder().realm("/even/two").
+                new AnySearchQuery.Builder().realm("/even/two").page(1).size(1000).
                 fiql(SyncopeClient.getGroupSearchConditionBuilder().isAssignable().
                         and("name").equalTo("*").query()).
                 build());


Mime
View raw message