syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [02/21] syncope git commit: Clean up: removing some not necessary methods from persistence-api and adjusting accordingly
Date Tue, 26 Jan 2016 12:04:33 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAAccountPolicy.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAAccountPolicy.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAAccountPolicy.java
index 7f87029..c5099f3 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAAccountPolicy.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAAccountPolicy.java
@@ -37,6 +37,7 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.Transformer;
 import org.apache.syncope.common.lib.policy.AccountRuleConf;
 import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.core.misc.utils.EntityUtils;
 import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.jpa.entity.resource.JPAExternalResource;
@@ -130,24 +131,13 @@ public class JPAAccountPolicy extends AbstractPolicy implements AccountPolicy {
     }
 
     @Override
-    public boolean remove(final ExternalResource resource) {
-        checkType(resource, JPAExternalResource.class);
-        return resources.remove((JPAExternalResource) resource);
-    }
-
-    @Override
     public Set<? extends ExternalResource> getResources() {
         return resources;
     }
 
     @Override
     public Set<String> getResourceNames() {
-        return CollectionUtils.collect(getResources(), new Transformer<ExternalResource, String>() {
-
-            @Override
-            public String transform(final ExternalResource input) {
-                return input.getKey();
-            }
-        }, new HashSet<String>());
+        return CollectionUtils.collect(
+                getResources(), EntityUtils.<String, ExternalResource>keyTransformer(), new HashSet<String>());
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
index 1f10447..12d5959 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAExternalResource.java
@@ -211,12 +211,6 @@ public class JPAExternalResource extends AbstractAnnotatedEntity<String> impleme
     }
 
     @Override
-    public boolean remove(final Provision provision) {
-        checkType(provision, JPAProvision.class);
-        return this.provisions.remove((JPAProvision) provision);
-    }
-
-    @Override
     public Provision getProvision(final ObjectClass objectClass) {
         return IterableUtils.find(provisions, new Predicate<Provision>() {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAMapping.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAMapping.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAMapping.java
index 752115c..63fb48d 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAMapping.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/resource/JPAMapping.java
@@ -84,12 +84,6 @@ public class JPAMapping extends AbstractEntity<Long> implements Mapping {
     }
 
     @Override
-    public boolean remove(final MappingItem item) {
-        checkType(item, JPAMappingItem.class);
-        return items.remove((JPAMappingItem) item);
-    }
-
-    @Override
     public List<? extends MappingItem> getItems() {
         return items;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/AbstractTask.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/AbstractTask.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/AbstractTask.java
index 938502d..4d67941 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/AbstractTask.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/AbstractTask.java
@@ -68,18 +68,12 @@ public abstract class AbstractTask extends AbstractEntity<Long> implements Task
     }
 
     @Override
-    public boolean addExec(final TaskExec exec) {
+    public boolean add(final TaskExec exec) {
         checkType(exec, JPATaskExec.class);
         return exec != null && !executions.contains((JPATaskExec) exec) && executions.add((JPATaskExec) exec);
     }
 
     @Override
-    public boolean removeExec(final TaskExec exec) {
-        checkType(exec, JPATaskExec.class);
-        return exec != null && executions.remove((JPATaskExec) exec);
-    }
-
-    @Override
     public List<? extends TaskExec> getExecs() {
         return executions;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPAPushTask.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPAPushTask.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPAPushTask.java
index a6f6d75..c6677e0 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPAPushTask.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPAPushTask.java
@@ -73,12 +73,6 @@ public class JPAPushTask extends AbstractProvisioningTask implements PushTask {
     }
 
     @Override
-    public boolean remove(final PushTaskAnyFilter filter) {
-        checkType(filter, JPAPushTaskAnyFilter.class);
-        return this.filters.remove((JPAPushTaskAnyFilter) filter);
-    }
-
-    @Override
     public PushTaskAnyFilter getFilter(final AnyType anyType) {
         return IterableUtils.find(filters, new Predicate<PushTaskAnyFilter>() {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPASyncTask.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPASyncTask.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPASyncTask.java
index b48a6e3..30b654e 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPASyncTask.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPASyncTask.java
@@ -121,12 +121,6 @@ public class JPASyncTask extends AbstractProvisioningTask implements SyncTask {
     }
 
     @Override
-    public boolean remove(final AnyTemplateSyncTask template) {
-        checkType(template, JPAAnyTemplateSyncTask.class);
-        return this.templates.remove((JPAAnyTemplateSyncTask) template);
-    }
-
-    @Override
     public AnyTemplateSyncTask getTemplate(final AnyType anyType) {
         return IterableUtils.find(templates, new Predicate<AnyTemplate>() {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/AbstractUDynMembership.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/AbstractUDynMembership.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/AbstractUDynMembership.java
index 5dd0902..d4fe264 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/AbstractUDynMembership.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/AbstractUDynMembership.java
@@ -37,12 +37,6 @@ public abstract class AbstractUDynMembership extends AbstractDynMembership<User>
     }
 
     @Override
-    public boolean remove(final User user) {
-        checkType(user, JPAUser.class);
-        return internalGetUsers().remove((JPAUser) user);
-    }
-
-    @Override
     public List<? extends User> getMembers() {
         return internalGetUsers();
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUPlainAttr.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUPlainAttr.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUPlainAttr.java
index 50ce967..38fa9a7 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUPlainAttr.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUPlainAttr.java
@@ -91,12 +91,6 @@ public class JPAUPlainAttr extends AbstractPlainAttr<User> implements UPlainAttr
     }
 
     @Override
-    public boolean remove(final PlainAttrValue attrValue) {
-        checkType(attrValue, JPAUPlainAttrValue.class);
-        return values.remove((JPAUPlainAttrValue) attrValue);
-    }
-
-    @Override
     public List<? extends UPlainAttrValue> getValues() {
         return values;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
index e4a6711..c8e6672 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/user/JPAUser.java
@@ -217,12 +217,6 @@ public class JPAUser extends AbstractAny<UPlainAttr> implements User {
     }
 
     @Override
-    public boolean remove(final Role role) {
-        checkType(role, JPARole.class);
-        return roles.remove((JPARole) role);
-    }
-
-    @Override
     public List<? extends Role> getRoles() {
         return roles;
     }
@@ -285,12 +279,6 @@ public class JPAUser extends AbstractAny<UPlainAttr> implements User {
     }
 
     @Override
-    public boolean remove(final UPlainAttr attr) {
-        checkType(attr, JPAUPlainAttr.class);
-        return plainAttrs.remove((JPAUPlainAttr) attr);
-    }
-
-    @Override
     public List<? extends UPlainAttr> getPlainAttrs() {
         return plainAttrs;
     }
@@ -481,12 +469,6 @@ public class JPAUser extends AbstractAny<UPlainAttr> implements User {
     }
 
     @Override
-    public boolean remove(final AnyTypeClass auxClass) {
-        checkType(auxClass, JPAAnyTypeClass.class);
-        return this.auxClasses.remove((JPAAnyTypeClass) auxClass);
-    }
-
-    @Override
     public List<? extends AnyTypeClass> getAuxClasses() {
         return auxClasses;
     }
@@ -498,12 +480,6 @@ public class JPAUser extends AbstractAny<UPlainAttr> implements User {
     }
 
     @Override
-    public boolean remove(final URelationship relationship) {
-        checkType(relationship, JPAURelationship.class);
-        return this.relationships.remove((JPAURelationship) relationship);
-    }
-
-    @Override
     public URelationship getRelationship(final RelationshipType relationshipType, final Long anyObjectKey) {
         return IterableUtils.find(getRelationships(), new Predicate<URelationship>() {
 
@@ -550,12 +526,6 @@ public class JPAUser extends AbstractAny<UPlainAttr> implements User {
     }
 
     @Override
-    public boolean remove(final UMembership membership) {
-        checkType(membership, JPAUMembership.class);
-        return this.memberships.remove((JPAUMembership) membership);
-    }
-
-    @Override
     public UMembership getMembership(final Long groupKey) {
         return IterableUtils.find(getMemberships(), new Predicate<UMembership>() {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskExecTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskExecTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskExecTest.java
index cdf4478..469816c 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskExecTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/TaskExecTest.java
@@ -81,7 +81,7 @@ public class TaskExecTest extends AbstractTest {
         exec.setStatus(PropagationTaskExecStatus.SUCCESS.name());
         exec.setMessage(faultyMessage);
 
-        task.addExec(exec);
+        task.add(exec);
         exec.setTask(task);
 
         exec = taskExecDAO.save(exec);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/GroupTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/GroupTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/GroupTest.java
index 7d40678..33980a2 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/GroupTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/GroupTest.java
@@ -30,8 +30,8 @@ import java.util.HashSet;
 import java.util.List;
 import javax.persistence.TypedQuery;
 import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.Transformer;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.core.misc.utils.EntityUtils;
 import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException;
 import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeClassDAO;
@@ -217,13 +217,9 @@ public class GroupTest extends AbstractTest {
         // 3. verify that expected users have the created group dynamically assigned
         assertEquals(2, actual.getUDynMembership().getMembers().size());
         assertEquals(new HashSet<>(Arrays.asList(4L, newUserKey)),
-                CollectionUtils.collect(actual.getUDynMembership().getMembers(), new Transformer<User, Long>() {
-
-                    @Override
-                    public Long transform(final User input) {
-                        return input.getKey();
-                    }
-                }, new HashSet<Long>()));
+                CollectionUtils.collect(actual.getUDynMembership().getMembers(),
+                        EntityUtils.<Long, User>keyTransformer(),
+                        new HashSet<Long>()));
 
         user = userDAO.find(4L);
         assertNotNull(user);
@@ -312,13 +308,8 @@ public class GroupTest extends AbstractTest {
         assertEquals(2, actual.getADynMembership(anyTypeDAO.find("PRINTER")).getMembers().size());
         assertEquals(new HashSet<>(Arrays.asList(1L, newAnyObjectKey)),
                 CollectionUtils.collect(actual.getADynMembership(anyTypeDAO.find("PRINTER")).getMembers(),
-                        new Transformer<AnyObject, Long>() {
-
-                    @Override
-                    public Long transform(final AnyObject input) {
-                        return input.getKey();
-                    }
-                }, new HashSet<Long>()));
+                        EntityUtils.<Long, AnyObject>keyTransformer(),
+                        new HashSet<Long>()));
 
         anyObject = anyObjectDAO.find(1L);
         assertNotNull(anyObject);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceTest.java
index 2a8a090..6f7e8be 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/ResourceTest.java
@@ -275,7 +275,7 @@ public class ResourceTest extends AbstractTest {
         }
 
         Provision groupProvision = ldap.getProvision(anyTypeDAO.findGroup());
-        ldap.remove(groupProvision);
+        ldap.getProvisions().remove(groupProvision);
         for (VirSchema schema : virSchemaDAO.findByProvision(groupProvision)) {
             virSchemaDAO.delete(schema.getKey());
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RoleTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RoleTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RoleTest.java
index a3a4ea6..f9d284f 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RoleTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/RoleTest.java
@@ -28,9 +28,9 @@ import java.util.Collection;
 import java.util.HashSet;
 import javax.persistence.TypedQuery;
 import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.Transformer;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.syncope.core.misc.utils.EntityUtils;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeClassDAO;
 import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
 import org.apache.syncope.core.persistence.api.dao.RealmDAO;
@@ -125,13 +125,9 @@ public class RoleTest extends AbstractTest {
         // 3. verify that expected users have the created role dynamically assigned
         assertEquals(2, actual.getDynMembership().getMembers().size());
         assertEquals(new HashSet<>(Arrays.asList(4L, newUserKey)),
-                CollectionUtils.collect(actual.getDynMembership().getMembers(), new Transformer<User, Long>() {
-
-                    @Override
-                    public Long transform(final User input) {
-                        return input.getKey();
-                    }
-                }, new HashSet<Long>()));
+                CollectionUtils.collect(actual.getDynMembership().getMembers(),
+                        EntityUtils.<Long, User>keyTransformer(),
+                        new HashSet<Long>()));
 
         user = userDAO.find(4L);
         assertNotNull(user);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/TaskTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/TaskTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/TaskTest.java
index 4a62a6a..ae07439 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/TaskTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/TaskTest.java
@@ -127,7 +127,7 @@ public class TaskTest extends AbstractTest {
         execution.setTask(task);
         execution.setStatus(PropagationTaskExecStatus.CREATED.name());
         execution.setStart(new Date());
-        task.addExec(execution);
+        task.add(execution);
 
         taskDAO.save(task);
         taskDAO.flush();
@@ -150,7 +150,7 @@ public class TaskTest extends AbstractTest {
         execution.setTask(task);
         execution.setStart(new Date());
         execution.setMessage("A message");
-        task.addExec(execution);
+        task.add(execution);
 
         taskDAO.save(task);
         taskDAO.flush();
@@ -173,7 +173,7 @@ public class TaskTest extends AbstractTest {
         execution.setTask(task);
         execution.setStart(new Date());
         execution.setMessage("A message");
-        task.addExec(execution);
+        task.add(execution);
 
         taskDAO.save(task);
         taskDAO.flush();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/UserTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/UserTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/UserTest.java
index 62bba9c..129b78c 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/UserTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/outer/UserTest.java
@@ -95,7 +95,7 @@ public class UserTest extends AbstractTest {
         assertEquals(1, user.getMemberships().size());
         assertEquals(7L, user.getMemberships().get(0).getRightEnd().getKey(), 0);
 
-        user.remove(user.getMemberships().get(0));
+        user.getMemberships().remove(0);
 
         UMembership newM = entityFactory.newEntity(UMembership.class);
         newM.setLeftEnd(user);
@@ -112,7 +112,7 @@ public class UserTest extends AbstractTest {
         assertEquals(1, user.getRelationships().size());
         assertEquals(1L, user.getRelationships().get(0).getRightEnd().getKey(), 0);
 
-        user.remove(user.getRelationships().get(0));
+        user.getRelationships().remove(0);
 
         URelationship newR = entityFactory.newEntity(URelationship.class);
         newR.setType(relationshipTypeDAO.find("neighborhood"));

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ConnInstanceDataBinder.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ConnInstanceDataBinder.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ConnInstanceDataBinder.java
index 373d1af..a111cc4 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ConnInstanceDataBinder.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ConnInstanceDataBinder.java
@@ -31,6 +31,6 @@ public interface ConnInstanceDataBinder {
 
     ConnInstanceTO getConnInstanceTO(ConnInstance connInstance);
 
-    ConnInstance update(long key, ConnInstanceTO connInstanceTO);
+    ConnInstance update(Long key, ConnInstanceTO connInstanceTO);
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java
index 686742a..3d96cfc 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AbstractAnyDataBinder.java
@@ -62,6 +62,7 @@ import org.apache.syncope.common.lib.types.PropagationByResource;
 import org.apache.syncope.core.misc.utils.ConnObjectUtils;
 import org.apache.syncope.core.misc.utils.MappingUtils;
 import org.apache.syncope.core.misc.jexl.JexlUtils;
+import org.apache.syncope.core.misc.utils.EntityUtils;
 import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
 import org.apache.syncope.core.persistence.api.dao.AnySearchDAO;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeClassDAO;
@@ -345,7 +346,7 @@ abstract class AbstractAnyDataBinder {
 
             case DELETE:
             default:
-                any.remove(attr);
+                any.getPlainAttrs().remove(attr);
                 plainAttrDAO.delete(attr.getKey(), anyUtils.plainAttrClass());
         }
 
@@ -382,7 +383,7 @@ abstract class AbstractAnyDataBinder {
 
                     case DELETE:
                     default:
-                        any.remove(auxClass);
+                        any.getAuxClasses().remove(auxClass);
                 }
             }
         }
@@ -402,7 +403,7 @@ abstract class AbstractAnyDataBinder {
                     case DELETE:
                     default:
                         propByRes.add(ResourceOperation.DELETE, resource.getKey());
-                        any.remove(resource);
+                        any.getResources().remove(resource);
                 }
             }
         }
@@ -513,13 +514,7 @@ abstract class AbstractAnyDataBinder {
 
         anyTO.setRealm(realmFullPath);
 
-        CollectionUtils.collect(auxClasses, new Transformer<AnyTypeClass, String>() {
-
-            @Override
-            public String transform(final AnyTypeClass role) {
-                return role.getKey();
-            }
-        }, anyTO.getAuxClasses());
+        CollectionUtils.collect(auxClasses, EntityUtils.<String, AnyTypeClass>keyTransformer(), anyTO.getAuxClasses());
 
         for (PlainAttr<?> plainAttr : plainAttrs) {
             AttrTO attrTO = new AttrTO();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/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 fbd090c..1c889f6 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
@@ -41,6 +41,7 @@ import org.apache.syncope.common.lib.types.PatchOperation;
 import org.apache.syncope.common.lib.types.PropagationByResource;
 import org.apache.syncope.common.lib.types.ResourceOperation;
 import org.apache.syncope.core.misc.spring.BeanUtils;
+import org.apache.syncope.core.misc.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;
@@ -111,13 +112,9 @@ public class AnyObjectDataBinderImpl extends AbstractAnyDataBinder implements An
             }, anyObjectTO.getMemberships());
 
             // dynamic memberships
-            CollectionUtils.collect(anyObjectDAO.findDynGroupMemberships(anyObject), new Transformer<Group, Long>() {
-
-                @Override
-                public Long transform(final Group group) {
-                    return group.getKey();
-                }
-            }, anyObjectTO.getDynGroups());
+            CollectionUtils.collect(anyObjectDAO.findDynGroupMemberships(anyObject),
+                    EntityUtils.<Long, Group>keyTransformer(),
+                    anyObjectTO.getDynGroups());
         }
 
         return anyObjectTO;
@@ -256,7 +253,7 @@ public class AnyObjectDataBinderImpl extends AbstractAnyDataBinder implements An
                     ARelationship relationship =
                             anyObject.getRelationship(relationshipType, patch.getRelationshipTO().getRightKey());
                     if (relationship != null) {
-                        anyObject.remove(relationship);
+                        anyObject.getRelationships().remove(relationship);
                         toBeDeprovisioned.addAll(relationship.getRightEnd().getResourceNames());
                     }
 
@@ -305,7 +302,7 @@ public class AnyObjectDataBinderImpl extends AbstractAnyDataBinder implements An
             if (patch.getMembershipTO() != null) {
                 AMembership membership = anyObject.getMembership(patch.getMembershipTO().getRightKey());
                 if (membership != null) {
-                    anyObject.remove(membership);
+                    anyObject.getMemberships().remove(membership);
                     toBeDeprovisioned.addAll(membership.getRightEnd().getResourceNames());
                 }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
index aa0549b..d4a6b08 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/ConnInstanceDataBinderImpl.java
@@ -44,7 +44,7 @@ import org.springframework.stereotype.Component;
 @Component
 public class ConnInstanceDataBinderImpl implements ConnInstanceDataBinder {
 
-    private static final String[] IGNORE_PROPERTIES = { "key", "poolConf" };
+    private static final String[] IGNORE_PROPERTIES = { "poolConf" };
 
     @Autowired
     private ConnIdBundleManager connIdBundleManager;
@@ -99,14 +99,14 @@ public class ConnInstanceDataBinderImpl implements ConnInstanceDataBinder {
     }
 
     @Override
-    public ConnInstance update(final long connInstanceId, final ConnInstanceTO connInstanceTO) {
+    public ConnInstance update(final Long key, final ConnInstanceTO connInstanceTO) {
         SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.RequiredValuesMissing);
 
-        if (connInstanceId == 0) {
-            sce.getElements().add("connector id");
+        if (key == 0) {
+            sce.getElements().add("connector key");
         }
 
-        ConnInstance connInstance = connInstanceDAO.find(connInstanceId);
+        ConnInstance connInstance = connInstanceDAO.find(key);
         connInstance.getCapabilities().clear();
         connInstance.getCapabilities().addAll(connInstanceTO.getCapabilities());
 
@@ -180,7 +180,6 @@ public class ConnInstanceDataBinderImpl implements ConnInstanceDataBinder {
     @Override
     public ConnInstanceTO getConnInstanceTO(final ConnInstance connInstance) {
         ConnInstanceTO connInstanceTO = new ConnInstanceTO();
-        connInstanceTO.setKey(connInstance.getKey() == null ? 0L : connInstance.getKey());
 
         BeanUtils.copyProperties(connInstance, connInstanceTO, IGNORE_PROPERTIES);
 
@@ -193,11 +192,11 @@ public class ConnInstanceDataBinderImpl implements ConnInstanceDataBinder {
             ConnConfProperty property = IterableUtils.find(connInstanceTO.getConf(),
                     new Predicate<ConnConfProperty>() {
 
-                        @Override
-                        public boolean evaluate(final ConnConfProperty candidate) {
-                            return propName.equals(candidate.getSchema().getName());
-                        }
-                    });
+                @Override
+                public boolean evaluate(final ConnConfProperty candidate) {
+                    return propName.equals(candidate.getSchema().getName());
+                }
+            });
             if (property == null) {
                 property = new ConnConfProperty();
                 connInstanceTO.getConf().add(property);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/GroupDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/GroupDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/GroupDataBinderImpl.java
index 20c52b3..a51729b 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/GroupDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/GroupDataBinderImpl.java
@@ -164,7 +164,7 @@ public class GroupDataBinderImpl extends AbstractAnyDataBinder implements GroupD
                 }
 
                 if (typeExt.getAuxClasses().isEmpty()) {
-                    group.remove(typeExt);
+                    group.getTypeExtensions().remove(typeExt);
                     typeExt.setGroup(null);
                 }
             }
@@ -280,7 +280,7 @@ public class GroupDataBinderImpl extends AbstractAnyDataBinder implements GroupD
 
                 // only consider non-empty type extensions
                 if (typeExt.getAuxClasses().isEmpty()) {
-                    group.remove(typeExt);
+                    group.getTypeExtensions().remove(typeExt);
                     typeExt.setGroup(null);
                 }
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/SchemaDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/SchemaDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/SchemaDataBinderImpl.java
index 002fbd9..dc8a957 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/SchemaDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/SchemaDataBinderImpl.java
@@ -100,7 +100,7 @@ public class SchemaDataBinderImpl implements SchemaDataBinder {
                 merged.setAnyTypeClass(anyTypeClass);
             }
         } else if (schemaTO.getAnyTypeClass() == null && merged.getAnyTypeClass() != null) {
-            merged.getAnyTypeClass().remove(merged);
+            merged.getAnyTypeClass().getPlainSchemas().remove(merged);
             merged.setAnyTypeClass(null);
         }
 
@@ -191,7 +191,7 @@ public class SchemaDataBinderImpl implements SchemaDataBinder {
                 merged.setAnyTypeClass(anyTypeClass);
             }
         } else if (schemaTO.getAnyTypeClass() == null && merged.getAnyTypeClass() != null) {
-            merged.getAnyTypeClass().remove(merged);
+            merged.getAnyTypeClass().getDerSchemas().remove(merged);
             merged.setAnyTypeClass(null);
         }
 
@@ -234,7 +234,7 @@ public class SchemaDataBinderImpl implements SchemaDataBinder {
                 schema.setAnyTypeClass(anyTypeClass);
             }
         } else if (schemaTO.getAnyTypeClass() == null && schema.getAnyTypeClass() != null) {
-            schema.getAnyTypeClass().remove(schema);
+            schema.getAnyTypeClass().getVirSchemas().remove(schema);
             schema.setAnyTypeClass(null);
         }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/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 1668fc4..36b3b77 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
@@ -56,6 +56,7 @@ import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
 import org.apache.syncope.core.misc.security.AuthContextUtils;
 import org.apache.syncope.core.misc.security.Encryptor;
 import org.apache.syncope.core.misc.spring.BeanUtils;
+import org.apache.syncope.core.misc.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;
@@ -121,11 +122,11 @@ public class UserDataBinderImpl extends AbstractAnyDataBinder implements UserDat
         String authUsername = AuthContextUtils.getUsername();
         if (anonymousUser.equals(authUsername)) {
             authUserTO = new UserTO();
-            authUserTO.setKey(-2);
+            authUserTO.setKey(-2L);
             authUserTO.setUsername(anonymousUser);
         } else if (adminUser.equals(authUsername)) {
             authUserTO = new UserTO();
-            authUserTO.setKey(-1);
+            authUserTO.setKey(-1L);
             authUserTO.setUsername(adminUser);
         } else {
             User authUser = userDAO.find(authUsername);
@@ -364,7 +365,7 @@ public class UserDataBinderImpl extends AbstractAnyDataBinder implements UserDat
 
                     case DELETE:
                     default:
-                        user.remove(role);
+                        user.getRoles().remove(role);
                 }
             }
         }
@@ -388,7 +389,7 @@ public class UserDataBinderImpl extends AbstractAnyDataBinder implements UserDat
                     URelationship relationship =
                             user.getRelationship(relationshipType, patch.getRelationshipTO().getRightKey());
                     if (relationship != null) {
-                        user.remove(relationship);
+                        user.getRelationships().remove(relationship);
                         toBeDeprovisioned.addAll(relationship.getRightEnd().getResourceNames());
                     }
 
@@ -426,7 +427,7 @@ public class UserDataBinderImpl extends AbstractAnyDataBinder implements UserDat
             if (patch.getMembershipTO() != null) {
                 UMembership membership = user.getMembership(patch.getMembershipTO().getRightKey());
                 if (membership != null) {
-                    user.remove(membership);
+                    user.getMemberships().remove(membership);
                     toBeDeprovisioned.addAll(membership.getRightEnd().getResourceNames());
                 }
 
@@ -516,13 +517,9 @@ public class UserDataBinderImpl extends AbstractAnyDataBinder implements UserDat
 
         if (details) {
             // roles
-            CollectionUtils.collect(user.getRoles(), new Transformer<Role, String>() {
-
-                @Override
-                public String transform(final Role role) {
-                    return role.getKey();
-                }
-            }, userTO.getRoles());
+            CollectionUtils.collect(user.getRoles(),
+                    EntityUtils.<String, Role>keyTransformer(),
+                    userTO.getRoles());
 
             // relationships
             CollectionUtils.collect(user.getRelationships(), new Transformer<URelationship, RelationshipTO>() {
@@ -544,20 +541,12 @@ public class UserDataBinderImpl extends AbstractAnyDataBinder implements UserDat
             }, userTO.getMemberships());
 
             // dynamic memberships
-            CollectionUtils.collect(userDAO.findDynRoleMemberships(user), new Transformer<Role, String>() {
-
-                @Override
-                public String transform(final Role role) {
-                    return role.getKey();
-                }
-            }, userTO.getDynRoles());
-            CollectionUtils.collect(userDAO.findDynGroupMemberships(user), new Transformer<Group, Long>() {
-
-                @Override
-                public Long transform(final Group group) {
-                    return group.getKey();
-                }
-            }, userTO.getDynGroups());
+            CollectionUtils.collect(userDAO.findDynRoleMemberships(user),
+                    EntityUtils.<String, Role>keyTransformer(),
+                    userTO.getDynRoles());
+            CollectionUtils.collect(userDAO.findDynGroupMemberships(user),
+                    EntityUtils.<Long, Group>keyTransformer(),
+                    userTO.getDynGroups());
         }
 
         return userTO;

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
index 82166dc..09594d4 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
@@ -408,7 +408,7 @@ public class NotificationManagerImpl implements NotificationManager {
     @Override
     public TaskExec storeExec(final TaskExec execution) {
         NotificationTask task = taskDAO.find(execution.getTask().getKey());
-        task.addExec(execution);
+        task.add(execution);
         task.setExecuted(true);
         taskDAO.save(task);
         // this flush call is needed to generate a value for the execution key

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
index 00affa6..b74471c 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/AbstractPropagationTaskExecutor.java
@@ -450,7 +450,7 @@ public abstract class AbstractPropagationTaskExecutor implements PropagationTask
                 LOG.debug("Execution to be stored: {}", execution);
 
                 execution.setTask(task);
-                task.addExec(execution);
+                task.add(execution);
 
                 taskDAO.save(task);
                 // needed to generate a value for the execution key

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ConnectorITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ConnectorITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ConnectorITCase.java
index 770a7cb..82f6f02 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ConnectorITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ConnectorITCase.java
@@ -303,7 +303,7 @@ public class ConnectorITCase extends AbstractITCase {
         resourceTO.setKey("newAbout103" + getUUIDString());
 
         // Make it new.
-        connInstanceTO.setKey(0);
+        connInstanceTO.setKey(0L);
         connInstanceTO.setDisplayName("newDisplayName" + getUUIDString());
         // ----------------------------------
 
@@ -695,7 +695,7 @@ public class ConnectorITCase extends AbstractITCase {
 
         ConnInstanceTO conn = connectorService.read(101L, Locale.ENGLISH.getLanguage());
 
-        conn.setKey(0);
+        conn.setKey(0L);
         conn.setDisplayName("forBulk1");
 
         bulkAction.getTargets().add(String.valueOf(getObject(

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PropagationTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PropagationTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PropagationTaskITCase.java
index d5c77e7..d2baebb 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PropagationTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/PropagationTaskITCase.java
@@ -134,12 +134,12 @@ public class PropagationTaskITCase extends AbstractTaskITCase {
         // check read
         PropagationTaskTO task = taskService.read(1L, false);
         assertNotNull(task);
-        assertEquals(1L, task.getKey());
+        assertEquals(1L, task.getKey(), 0);
         assertTrue(task.getExecutions().isEmpty());
 
         task = taskService.read(1L, true);
         assertNotNull(task);
-        assertEquals(1L, task.getKey());
+        assertEquals(1L, task.getKey(), 0);
         assertFalse(task.getExecutions().isEmpty());
 
         // check list executions

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RealmITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RealmITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RealmITCase.java
index 11892af..4b727cf 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RealmITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/RealmITCase.java
@@ -84,7 +84,7 @@ public class RealmITCase extends AbstractITCase {
         assertNotNull(actual.getKey());
         assertEquals("last", actual.getName());
         assertEquals("/even/two/last", actual.getFullPath());
-        assertEquals(actual.getParent(), getRealm("/even/two").getKey());
+        assertEquals(actual.getParent(), getRealm("/even/two").getKey(), 0);
         assertNull(realm.getAccountPolicy());
         assertNull(realm.getPasswordPolicy());
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ReportITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ReportITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ReportITCase.java
index aea35a9..c30cb19 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ReportITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/ReportITCase.java
@@ -184,7 +184,7 @@ public class ReportITCase extends AbstractITCase {
     @Test
     public void executeAndExport() throws IOException {
         ReportTO reportTO = reportService.read(1L);
-        reportTO.setKey(0);
+        reportTO.setKey(0L);
         reportTO.setName("executeAndExport" + getUUIDString());
         reportTO.setActive(false);
         reportTO.getExecutions().clear();
@@ -220,7 +220,7 @@ public class ReportITCase extends AbstractITCase {
         }
 
         ReportTO reportTO = reportService.read(1L);
-        reportTO.setKey(0);
+        reportTO.setKey(0L);
         reportTO.setName("deleteExecutions" + getUUIDString());
         reportTO.getExecutions().clear();
         reportTO = createReport(reportTO);
@@ -274,7 +274,7 @@ public class ReportITCase extends AbstractITCase {
     public void issueSYNCOPE102() throws IOException {
         // Create
         ReportTO reportTO = reportService.read(1L);
-        reportTO.setKey(0);
+        reportTO.setKey(0L);
         reportTO.setName("issueSYNCOPE102" + getUUIDString());
         reportTO = createReport(reportTO);
         assertNotNull(reportTO);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SchedTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SchedTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SchedTaskITCase.java
index 327abe8..8832540 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SchedTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/SchedTaskITCase.java
@@ -75,7 +75,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
         assertNotNull(task);
 
         SchedTaskTO taskMod = new SchedTaskTO();
-        taskMod.setKey(5);
+        taskMod.setKey(5L);
         taskMod.setCronExpression(null);
 
         taskService.update(taskMod);
@@ -189,7 +189,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
         } while (list.size() < 1 && i < maxit);
 
         assertEquals(1, list.size());
-        assertEquals(task.getKey(), list.get(0).getTask());
+        assertEquals(task.getKey(), list.get(0).getTask(), 0);
 
         taskService.actionJob(task.getKey(), JobAction.STOP);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/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 db9156a..d047347 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
@@ -84,7 +84,7 @@ public class SearchITCase extends AbstractITCase {
         assertNotNull(matchingUsers);
         assertEquals(1, matchingUsers.getResult().size());
         assertEquals("rossini", matchingUsers.getResult().iterator().next().getUsername());
-        assertEquals(1L, matchingUsers.getResult().iterator().next().getKey());
+        assertEquals(1L, matchingUsers.getResult().iterator().next().getKey(), 0);
     }
 
     @Test
@@ -96,7 +96,7 @@ public class SearchITCase extends AbstractITCase {
         assertNotNull(groups);
         assertEquals(1, groups.getResult().size());
         assertEquals("root", groups.getResult().iterator().next().getName());
-        assertEquals(1L, groups.getResult().iterator().next().getKey());
+        assertEquals(1L, groups.getResult().iterator().next().getKey(), 0);
     }
 
     @Test
@@ -240,7 +240,7 @@ public class SearchITCase extends AbstractITCase {
                 fiql(SyncopeClient.getGroupSearchConditionBuilder().is("userOwner").equalTo(5).query()).build());
         assertNotNull(groups);
         assertEquals(1, groups.getResult().size());
-        assertEquals(6L, groups.getResult().iterator().next().getKey());
+        assertEquals(6L, groups.getResult().iterator().next().getKey(), 0);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
index 199fe0b..dd8242b 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserITCase.java
@@ -488,7 +488,7 @@ public class UserITCase extends AbstractITCase {
         ProvisioningResult<UserTO> result = deleteUser(key);
         assertNotNull(result);
         userTO = result.getAny();
-        assertEquals(key, userTO.getKey());
+        assertEquals(key, userTO.getKey(), 0);
         assertTrue(userTO.getPlainAttrs().isEmpty());
 
         // check for propagation result
@@ -517,7 +517,7 @@ public class UserITCase extends AbstractITCase {
         ProvisioningResult<UserTO> result = deleteUser(userTO.getKey());
         assertNotNull(result);
         userTO = result.getAny();
-        assertEquals(key, userTO.getKey());
+        assertEquals(key, userTO.getKey(), 0);
         assertTrue(userTO.getPlainAttrs().isEmpty());
 
         // check for propagation result

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserWorkflowITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserWorkflowITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserWorkflowITCase.java
index 150b0bc..02a2c7a 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserWorkflowITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/UserWorkflowITCase.java
@@ -72,7 +72,7 @@ public class UserWorkflowITCase extends AbstractITCase {
         WorkflowFormTO form = userWorkflowService.getFormForUser(userTO.getKey());
         assertNotNull(form);
         assertNotNull(form.getUserKey());
-        assertEquals(userTO.getKey(), form.getUserKey());
+        assertEquals(userTO.getKey(), form.getUserKey(), 0);
         assertNotNull(form.getTaskId());
         assertNull(form.getOwner());
 
@@ -230,7 +230,7 @@ public class UserWorkflowITCase extends AbstractITCase {
         // 1. create user with group 9 (and verify that no propagation occurred)
         userTO = createUser(userTO).getAny();
         assertNotNull(userTO);
-        assertNotEquals(0L, userTO.getKey());
+        assertNotEquals(0L, userTO.getKey(), 0);
         assertNotNull(userTO.getCreationDate());
         assertNotNull(userTO.getCreator());
         assertNotNull(userTO.getLastChangeDate());

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirSchemaITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirSchemaITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirSchemaITCase.java
index 56d8186..a6a2444 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirSchemaITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/VirSchemaITCase.java
@@ -65,7 +65,7 @@ public class VirSchemaITCase extends AbstractITCase {
 
         schema = createSchema(SchemaType.VIRTUAL, schema);
         assertNotNull(schema);
-        assertEquals(csv.getProvisions().get(0).getKey(), schema.getProvision());
+        assertEquals(csv.getProvisions().get(0).getKey(), schema.getProvision(), 0);
 
         csv = resourceService.read(RESOURCE_NAME_CSV);
         assertNotNull(csv);


Mime
View raw message