[SYNCOPE-944] Clean up

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

Branch: refs/heads/master
Commit: fc7ddd9bcb271fee036129173028a42840af6125
Parents: 1c1db24
Author: Francesco Chicchiriccò <ilgro...@apache.org>
Authored: Mon Sep 19 09:50:57 2016 +0200
Committer: Francesco Chicchiriccò <ilgro...@apache.org>
Committed: Mon Sep 19 09:52:35 2016 +0200

----------------------------------------------------------------------
 .../provisioning/java/data/AnyObjectDataBinderImpl.java     | 9 ++-------
 .../core/provisioning/java/data/UserDataBinderImpl.java     | 9 ++-------
 2 files changed, 4 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/fc7ddd9b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
----------------------------------------------------------------------
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
index 7494009..a998a66 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyObjectDataBinderImpl.java
@@ -45,8 +45,6 @@ import org.apache.syncope.common.lib.types.ResourceOperation;
 import org.apache.syncope.core.spring.BeanUtils;
 import org.apache.syncope.core.provisioning.api.utils.EntityUtils;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
-import org.apache.syncope.core.persistence.api.dao.search.AssignableCond;
-import org.apache.syncope.core.persistence.api.dao.search.SearchCond;
 import org.apache.syncope.core.persistence.api.entity.AnyType;
 import org.apache.syncope.core.persistence.api.entity.AnyUtils;
 import org.apache.syncope.core.persistence.api.entity.PlainSchema;
@@ -166,12 +164,9 @@ public class AnyObjectDataBinderImpl extends 
AbstractAnyDataBinder implements An
 
         AnyUtils anyUtils = 
anyUtilsFactory.getInstance(AnyTypeKind.ANY_OBJECT);
         if (anyObject.getRealm() != null) {
-            AssignableCond assignableCond = new AssignableCond();
-            
assignableCond.setRealmFullPath(anyObject.getRealm().getFullPath());
-
             // relationships
             Collection<String> assignableAnyObjects = CollectionUtils.collect(
-                    searchDAO.search(SearchCond.getLeafCond(assignableCond), 
AnyTypeKind.ANY_OBJECT),
+                    
searchDAO.searchAssignable(anyObject.getRealm().getFullPath(), 
AnyTypeKind.ANY_OBJECT),
                     EntityUtils.keyTransformer());
 
             for (RelationshipTO relationshipTO : 
anyObjectTO.getRelationships()) {
@@ -213,7 +208,7 @@ public class AnyObjectDataBinderImpl extends 
AbstractAnyDataBinder implements An
 
             // memberships
             Collection<String> assignableGroups = CollectionUtils.collect(
-                    searchDAO.search(SearchCond.getLeafCond(assignableCond), 
AnyTypeKind.GROUP),
+                    
searchDAO.searchAssignable(anyObject.getRealm().getFullPath(), 
AnyTypeKind.GROUP),
                     EntityUtils.keyTransformer());
 
             for (MembershipTO membershipTO : anyObjectTO.getMemberships()) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/fc7ddd9b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
----------------------------------------------------------------------
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
index eeef4fd..5816820 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
@@ -61,8 +61,6 @@ import org.apache.syncope.core.spring.BeanUtils;
 import org.apache.syncope.core.provisioning.api.utils.EntityUtils;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
 import org.apache.syncope.core.persistence.api.dao.RoleDAO;
-import org.apache.syncope.core.persistence.api.dao.search.AssignableCond;
-import org.apache.syncope.core.persistence.api.dao.search.SearchCond;
 import org.apache.syncope.core.persistence.api.entity.AnyUtils;
 import org.apache.syncope.core.persistence.api.entity.PlainSchema;
 import org.apache.syncope.core.persistence.api.entity.Realm;
@@ -192,12 +190,9 @@ public class UserDataBinderImpl extends 
AbstractAnyDataBinder implements UserDat
 
         AnyUtils anyUtils = anyUtilsFactory.getInstance(AnyTypeKind.USER);
         if (user.getRealm() != null) {
-            AssignableCond assignableCond = new AssignableCond();
-            assignableCond.setRealmFullPath(user.getRealm().getFullPath());
-
             // relationships
             Collection<String> assignableAnyObjects = CollectionUtils.collect(
-                    searchDAO.search(SearchCond.getLeafCond(assignableCond), 
AnyTypeKind.ANY_OBJECT),
+                    searchDAO.searchAssignable(user.getRealm().getFullPath(), 
AnyTypeKind.ANY_OBJECT),
                     EntityUtils.keyTransformer());
 
             for (RelationshipTO relationshipTO : userTO.getRelationships()) {
@@ -229,7 +224,7 @@ public class UserDataBinderImpl extends 
AbstractAnyDataBinder implements UserDat
 
             // memberships
             Collection<String> assignableGroups = CollectionUtils.collect(
-                    searchDAO.search(SearchCond.getLeafCond(assignableCond), 
AnyTypeKind.GROUP),
+                    searchDAO.searchAssignable(user.getRealm().getFullPath(), 
AnyTypeKind.GROUP),
                     EntityUtils.keyTransformer());
 
             for (MembershipTO membershipTO : userTO.getMemberships()) {

Reply via email to