syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [03/21] syncope git commit: Clean up: removing some not necessary methods from persistence-api and adjusting accordingly
Date Tue, 26 Jan 2016 12:04:34 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/common/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTypeTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTypeTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTypeTO.java
index d1d72f7..f790255 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTypeTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTypeTO.java
@@ -25,7 +25,7 @@ import org.apache.syncope.common.lib.AbstractBaseBean;
 
 @XmlRootElement(name = "relationshipType")
 @XmlType
-public class RelationshipTypeTO extends AbstractBaseBean {
+public class RelationshipTypeTO extends AbstractBaseBean implements EntityTO<String> {
 
     private static final long serialVersionUID = -1884088415277925817L;
 
@@ -33,11 +33,13 @@ public class RelationshipTypeTO extends AbstractBaseBean {
 
     private String description;
 
+    @Override
     public String getKey() {
         return key;
     }
 
     @Path("{key}")
+    @Override
     public void setKey(final String key) {
         this.key = key;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/common/lib/src/main/java/org/apache/syncope/common/lib/to/ReportTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ReportTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ReportTO.java
index 73297fc..82f48a4 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ReportTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ReportTO.java
@@ -31,11 +31,11 @@ import org.apache.syncope.common.lib.report.AbstractReportletConf;
 
 @XmlRootElement(name = "report")
 @XmlType
-public class ReportTO extends AbstractStartEndBean {
+public class ReportTO extends AbstractStartEndBean implements EntityTO<Long> {
 
     private static final long serialVersionUID = 5274568072084814410L;
 
-    private long key;
+    private Long key;
 
     private String name;
 
@@ -53,12 +53,14 @@ public class ReportTO extends AbstractStartEndBean {
 
     private boolean active;
 
-    public long getKey() {
+    @Override
+    public Long getKey() {
         return key;
     }
 
     @PathParam("key")
-    public void setKey(final long key) {
+    @Override
+    public void setKey(final Long key) {
         this.key = key;
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
index a4f56ab..5f75794 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ResourceTO.java
@@ -38,7 +38,7 @@ import org.apache.syncope.common.lib.types.TraceLevel;
 
 @XmlRootElement(name = "resource")
 @XmlType
-public class ResourceTO extends AbstractAnnotatedBean {
+public class ResourceTO extends AbstractAnnotatedBean implements EntityTO<String> {
 
     private static final long serialVersionUID = -9193551354041698963L;
 
@@ -84,11 +84,13 @@ public class ResourceTO extends AbstractAnnotatedBean {
 
     private final List<String> propagationActionsClassNames = new ArrayList<>();
 
+    @Override
     public String getKey() {
         return key;
     }
 
     @PathParam("key")
+    @Override
     public void setKey(final String key) {
         this.key = key;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/common/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java
index 7160fdc..bf59bb5 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java
@@ -32,7 +32,7 @@ import org.apache.syncope.common.lib.AbstractBaseBean;
 
 @XmlRootElement(name = "role")
 @XmlType
-public class RoleTO extends AbstractBaseBean {
+public class RoleTO extends AbstractBaseBean implements EntityTO<String> {
 
     private static final long serialVersionUID = 4560822655754800031L;
 
@@ -44,11 +44,13 @@ public class RoleTO extends AbstractBaseBean {
 
     private String dynMembershipCond;
 
+    @Override
     public String getKey() {
         return key;
     }
 
     @PathParam("key")
+    @Override
     public void setKey(final String key) {
         this.key = key;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/common/lib/src/main/java/org/apache/syncope/common/lib/to/SecurityQuestionTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/SecurityQuestionTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/SecurityQuestionTO.java
index 83a8c55..aa7e2ce 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/SecurityQuestionTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/SecurityQuestionTO.java
@@ -25,20 +25,22 @@ import org.apache.syncope.common.lib.AbstractBaseBean;
 
 @XmlRootElement(name = "securityQuestion")
 @XmlType
-public class SecurityQuestionTO extends AbstractBaseBean {
+public class SecurityQuestionTO extends AbstractBaseBean implements EntityTO<Long> {
 
     private static final long serialVersionUID = 5969810939993556530L;
 
-    private long key;
+    private Long key;
 
     private String content;
 
-    public long getKey() {
+    @Override
+    public Long getKey() {
         return key;
     }
 
     @PathParam("key")
-    public void setKey(final long key) {
+    @Override
+    public void setKey(final Long key) {
         this.key = key;
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
index 4ad7959..e754798 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
@@ -38,7 +38,7 @@ import org.apache.syncope.common.lib.types.AnyTypeKind;
 
 @XmlRootElement(name = "user")
 @XmlType
-public class UserTO extends AnyTO {
+public class UserTO extends AnyTO implements RelatableTO, GroupableTO {
 
     private static final long serialVersionUID = 7791304495192615740L;
 
@@ -183,29 +183,31 @@ public class UserTO extends AnyTO {
     @XmlElementWrapper(name = "relationships")
     @XmlElement(name = "relationship")
     @JsonProperty("relationships")
+    @Override
     public List<RelationshipTO> getRelationships() {
         return relationships;
     }
 
     @JsonIgnore
+    @Override
     public Map<Pair<String, Long>, RelationshipTO> getRelationshipMap() {
         Map<Pair<String, Long>, RelationshipTO> result = new HashMap<>(getRelationships().size());
         for (RelationshipTO relationship : getRelationships()) {
             result.put(Pair.of(relationship.getType(), relationship.getRightKey()), relationship);
         }
-        result = Collections.unmodifiableMap(result);
-
-        return result;
+        return Collections.unmodifiableMap(result);
     }
 
     @XmlElementWrapper(name = "memberships")
     @XmlElement(name = "membership")
     @JsonProperty("memberships")
+    @Override
     public List<MembershipTO> getMemberships() {
         return memberships;
     }
 
     @JsonIgnore
+    @Override
     public Map<Long, MembershipTO> getMembershipMap() {
         Map<Long, MembershipTO> result = new HashMap<>(getMemberships().size());
         for (MembershipTO membership : getMemberships()) {
@@ -219,6 +221,7 @@ public class UserTO extends AnyTO {
     @XmlElementWrapper(name = "dynGroups")
     @XmlElement(name = "role")
     @JsonProperty("dynGroups")
+    @Override
     public List<Long> getDynGroups() {
         return dynGroups;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/misc/src/main/java/org/apache/syncope/core/misc/utils/EntityUtils.java
----------------------------------------------------------------------
diff --git a/core/misc/src/main/java/org/apache/syncope/core/misc/utils/EntityUtils.java b/core/misc/src/main/java/org/apache/syncope/core/misc/utils/EntityUtils.java
new file mode 100644
index 0000000..e47efc8
--- /dev/null
+++ b/core/misc/src/main/java/org/apache/syncope/core/misc/utils/EntityUtils.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.misc.utils;
+
+import org.apache.commons.collections4.Transformer;
+import org.apache.syncope.core.persistence.api.entity.Entity;
+
+public final class EntityUtils {
+
+    public static <KEY, E extends Entity<KEY>> Transformer<E, KEY> keyTransformer() {
+        return new Transformer<E, KEY>() {
+
+            @Override
+            public KEY transform(final E input) {
+                return input.getKey();
+            }
+        };
+    }
+
+    /**
+     * Private default constructor, for static-only classes.
+     */
+    private EntityUtils() {
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/misc/src/main/java/org/apache/syncope/core/misc/utils/TemplateUtils.java
----------------------------------------------------------------------
diff --git a/core/misc/src/main/java/org/apache/syncope/core/misc/utils/TemplateUtils.java b/core/misc/src/main/java/org/apache/syncope/core/misc/utils/TemplateUtils.java
index 432913d..e09e0e2 100644
--- a/core/misc/src/main/java/org/apache/syncope/core/misc/utils/TemplateUtils.java
+++ b/core/misc/src/main/java/org/apache/syncope/core/misc/utils/TemplateUtils.java
@@ -109,7 +109,7 @@ public class TemplateUtils {
             final List<RelationshipTO> anyRels, final List<RelationshipTO> templateRels) {
 
         for (RelationshipTO memb : templateRels) {
-            if (!anyRelMap.containsKey(memb.getRightKey())) {
+            if (!anyRelMap.containsKey(Pair.of(memb.getRightType(), memb.getRightKey()))) {
                 anyRels.add(memb);
             }
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
index d14d3b0..c5d4af7 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Any.java
@@ -41,23 +41,17 @@ public interface Any<P extends PlainAttr<?>> extends AnnotatedEntity<Long> {
 
     boolean add(P attr);
 
-    boolean remove(P attr);
-
     P getPlainAttr(String plainSchemaName);
 
     List<? extends P> getPlainAttrs();
 
     boolean add(ExternalResource resource);
 
-    boolean remove(ExternalResource resource);
-
     List<String> getResourceNames();
 
     List<? extends ExternalResource> getResources();
 
     boolean add(AnyTypeClass auxClass);
 
-    boolean remove(AnyTypeClass auxClass);
-
     List<? extends AnyTypeClass> getAuxClasses();
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyType.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyType.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyType.java
index c23897c..0a807fb 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyType.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyType.java
@@ -31,7 +31,5 @@ public interface AnyType extends Entity<String> {
 
     boolean add(AnyTypeClass anyTypeClass);
 
-    boolean remove(AnyTypeClass anyTypeClass);
-
     List<? extends AnyTypeClass> getClasses();
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyTypeClass.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyTypeClass.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyTypeClass.java
index e1e5411..f6682b5 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyTypeClass.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyTypeClass.java
@@ -28,19 +28,13 @@ public interface AnyTypeClass extends Entity<String> {
 
     boolean add(PlainSchema schema);
 
-    boolean remove(PlainSchema schema);
-
     List<? extends PlainSchema> getPlainSchemas();
 
     boolean add(DerSchema schema);
 
-    boolean remove(DerSchema schema);
-
     List<? extends DerSchema> getDerSchemas();
 
     boolean add(VirSchema schema);
 
-    boolean remove(VirSchema schema);
-
     List<? extends VirSchema> getVirSchemas();
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java
index 2019e8e..43af15b 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/ConnInstance.java
@@ -54,8 +54,6 @@ public interface ConnInstance extends Entity<Long> {
 
     boolean add(ExternalResource resource);
 
-    boolean remove(ExternalResource resource);
-
     List<? extends ExternalResource> getResources();
 
     void setConf(Set<ConnConfProperty> conf);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/DynMembership.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/DynMembership.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/DynMembership.java
index 2ad2425..9062bd9 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/DynMembership.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/DynMembership.java
@@ -28,7 +28,5 @@ public interface DynMembership<A extends Any<?>> extends Entity<Long> {
 
     boolean add(A any);
 
-    boolean remove(A any);
-
     List<? extends A> getMembers();
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Notification.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Notification.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Notification.java
index bb395fa..dcda3d6 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Notification.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Notification.java
@@ -50,8 +50,6 @@ public interface Notification extends Entity<Long> {
 
     boolean add(AnyAbout about);
 
-    boolean remove(AnyAbout about);
-
     AnyAbout getAbout(AnyType anyType);
 
     List<? extends AnyAbout> getAbouts();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/PlainAttr.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/PlainAttr.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/PlainAttr.java
index 5107f54..b7bdc0c 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/PlainAttr.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/PlainAttr.java
@@ -34,8 +34,6 @@ public interface PlainAttr<A extends Any<?>> extends Entity<Long> {
 
     void add(String value, PlainAttrValue attrValue);
 
-    boolean remove(PlainAttrValue attrValue);
-
     PlainAttrUniqueValue getUniqueValue();
 
     void setUniqueValue(PlainAttrUniqueValue uniqueValue);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Realm.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Realm.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Realm.java
index f973138..71b7a22 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Realm.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Realm.java
@@ -47,8 +47,6 @@ public interface Realm extends Entity<Long> {
 
     boolean add(AnyTemplateRealm template);
 
-    boolean remove(AnyTemplateRealm template);
-
     AnyTemplateRealm getTemplate(AnyType anyType);
 
     List<? extends AnyTemplateRealm> getTemplates();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Report.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Report.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Report.java
index 5b31063..48c8f68 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Report.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Report.java
@@ -29,8 +29,6 @@ public interface Report extends Entity<Long> {
 
     boolean add(ReportExec exec);
 
-    boolean remove(ReportExec exec);
-
     List<? extends ReportExec> getExecs();
 
     boolean add(ReportletConf reportletConf);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Role.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Role.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Role.java
index c26c15b..3987e96 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Role.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Role.java
@@ -30,8 +30,6 @@ public interface Role extends Entity<String> {
 
     boolean add(Realm realm);
 
-    boolean remove(Realm realm);
-
     List<? extends Realm> getRealms();
 
     DynRoleMembership getDynMembership();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/anyobject/AnyObject.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/anyobject/AnyObject.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/anyobject/AnyObject.java
index 666b82c..c40c643 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/anyobject/AnyObject.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/anyobject/AnyObject.java
@@ -27,8 +27,6 @@ public interface AnyObject extends Any<APlainAttr> {
 
     boolean add(ARelationship relationship);
 
-    boolean remove(ARelationship relationship);
-
     ARelationship getRelationship(RelationshipType relationshipType, Long anyObjectKey);
 
     Collection<? extends ARelationship> getRelationships(Long anyObjectKey);
@@ -39,8 +37,6 @@ public interface AnyObject extends Any<APlainAttr> {
 
     boolean add(AMembership membership);
 
-    boolean remove(AMembership membership);
-
     AMembership getMembership(Long membershipKey);
 
     List<? extends AMembership> getMemberships();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/conf/Conf.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/conf/Conf.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/conf/Conf.java
index f31b21a..64c60d0 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/conf/Conf.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/conf/Conf.java
@@ -29,9 +29,6 @@ public interface Conf extends Any<CPlainAttr> {
     boolean add(CPlainAttr attr);
 
     @Override
-    boolean remove(CPlainAttr attr);
-
-    @Override
     List<? extends CPlainAttr> getPlainAttrs();
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/group/Group.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/group/Group.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/group/Group.java
index 74a32f3..b696eee 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/group/Group.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/group/Group.java
@@ -43,9 +43,6 @@ public interface Group extends Any<GPlainAttr> {
     boolean add(GPlainAttr attr);
 
     @Override
-    boolean remove(GPlainAttr attr);
-
-    @Override
     GPlainAttr getPlainAttr(String plainSchemaName);
 
     @Override
@@ -57,16 +54,12 @@ public interface Group extends Any<GPlainAttr> {
 
     boolean add(ADynGroupMembership dynGroupMembership);
 
-    boolean remove(ADynGroupMembership dynGroupMembership);
-
     ADynGroupMembership getADynMembership(AnyType anyType);
 
     List<? extends ADynGroupMembership> getADynMemberships();
 
     boolean add(TypeExtension typeExtension);
 
-    boolean remove(TypeExtension typeExtension);
-
     TypeExtension getTypeExtension(AnyType anyType);
 
     List<? extends TypeExtension> getTypeExtensions();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/group/TypeExtension.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/group/TypeExtension.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/group/TypeExtension.java
index a426146..450112f 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/group/TypeExtension.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/group/TypeExtension.java
@@ -35,7 +35,5 @@ public interface TypeExtension extends Entity<Long> {
 
     boolean add(AnyTypeClass anyTypeClass);
 
-    boolean remove(AnyTypeClass anyTypeClass);
-
     List<? extends AnyTypeClass> getAuxClasses();
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/AccountPolicy.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/AccountPolicy.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/AccountPolicy.java
index 066efdf..6aed282 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/AccountPolicy.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/AccountPolicy.java
@@ -42,8 +42,6 @@ public interface AccountPolicy extends Policy {
 
     boolean add(ExternalResource resource);
 
-    boolean remove(ExternalResource resource);
-
     Set<String> getResourceNames();
 
     Set<? extends ExternalResource> getResources();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/ExternalResource.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/ExternalResource.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/ExternalResource.java
index 968b779..32759cd 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/ExternalResource.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/ExternalResource.java
@@ -93,8 +93,6 @@ public interface ExternalResource extends AnnotatedEntity<String> {
 
     boolean add(Provision provision);
 
-    boolean remove(Provision provision);
-
     Provision getProvision(AnyType anyType);
 
     Provision getProvision(ObjectClass objectClass);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/Mapping.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/Mapping.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/Mapping.java
index ea9f165..02ac485 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/Mapping.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/resource/Mapping.java
@@ -29,8 +29,6 @@ public interface Mapping extends Entity<Long> {
 
     boolean add(MappingItem item);
 
-    boolean remove(MappingItem item);
-
     MappingItem getConnObjectKeyItem();
 
     void setConnObjectKeyItem(MappingItem item);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/PushTask.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/PushTask.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/PushTask.java
index 0052cd5..93e112d 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/PushTask.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/PushTask.java
@@ -25,8 +25,6 @@ public interface PushTask extends ProvisioningTask {
 
     boolean add(PushTaskAnyFilter filter);
 
-    boolean remove(PushTaskAnyFilter filter);
-
     PushTaskAnyFilter getFilter(AnyType anyType);
 
     List<? extends PushTaskAnyFilter> getFilters();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/SyncTask.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/SyncTask.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/SyncTask.java
index ca07988..127b1cf 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/SyncTask.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/SyncTask.java
@@ -39,8 +39,6 @@ public interface SyncTask extends ProvisioningTask {
 
     boolean add(AnyTemplateSyncTask template);
 
-    boolean remove(AnyTemplateSyncTask template);
-
     AnyTemplateSyncTask getTemplate(AnyType anyType);
 
     List<? extends AnyTemplateSyncTask> getTemplates();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/Task.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/Task.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/Task.java
index b356356..7d2c9f6 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/Task.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/Task.java
@@ -26,9 +26,7 @@ public interface Task extends Entity<Long> {
 
     TaskType getType();
 
-    boolean addExec(TaskExec exec);
-
-    boolean removeExec(TaskExec exec);
+    boolean add(TaskExec exec);
 
     List<? extends TaskExec> getExecs();
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/user/User.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/user/User.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/user/User.java
index cbec1c9..d1b94e7 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/user/User.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/user/User.java
@@ -96,9 +96,6 @@ public interface User extends Any<UPlainAttr> {
     boolean add(UPlainAttr attr);
 
     @Override
-    boolean remove(UPlainAttr attr);
-
-    @Override
     UPlainAttr getPlainAttr(String plainSchemaName);
 
     @Override
@@ -106,14 +103,10 @@ public interface User extends Any<UPlainAttr> {
 
     boolean add(Role role);
 
-    boolean remove(Role role);
-
     List<? extends Role> getRoles();
 
     boolean add(URelationship relationship);
 
-    boolean remove(URelationship relationship);
-
     URelationship getRelationship(RelationshipType relationshipType, Long anyObjectKey);
 
     Collection<? extends URelationship> getRelationships(Long anyObjectKey);
@@ -124,8 +117,6 @@ public interface User extends Any<UPlainAttr> {
 
     boolean add(UMembership membership);
 
-    boolean remove(UMembership membership);
-
     UMembership getMembership(Long groupKey);
 
     List<? extends UMembership> getMemberships();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
index 659952b..e27c1c9 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
@@ -33,6 +33,7 @@ import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.core.misc.EntitlementsHolder;
 import org.apache.syncope.core.misc.security.AuthContextUtils;
 import org.apache.syncope.core.misc.security.DelegatedAdministrationException;
+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.GroupDAO;
 import org.apache.syncope.core.persistence.api.entity.AnyUtils;
@@ -110,7 +111,7 @@ public class JPAAnyObjectDAO extends AbstractAnyDAO<AnyObject> implements AnyObj
     @Override
     public void delete(final AnyObject any) {
         for (Group group : findDynGroupMemberships(any)) {
-            group.getADynMembership(any.getType()).remove(any);
+            group.getADynMembership(any.getType()).getMembers().remove(any);
         }
 
         entityManager().remove(any);
@@ -144,13 +145,7 @@ public class JPAAnyObjectDAO extends AbstractAnyDAO<AnyObject> implements AnyObj
     @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
     @Override
     public Collection<Long> findAllGroupKeys(final AnyObject anyObject) {
-        return CollectionUtils.collect(findAllGroups(anyObject), new Transformer<Group, Long>() {
-
-            @Override
-            public Long transform(final Group input) {
-                return input.getKey();
-            }
-        });
+        return CollectionUtils.collect(findAllGroups(anyObject), EntityUtils.<Long, Group>keyTransformer());
     }
 
     @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
@@ -168,13 +163,8 @@ public class JPAAnyObjectDAO extends AbstractAnyDAO<AnyObject> implements AnyObj
     @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true)
     @Override
     public Collection<String> findAllResourceNames(final AnyObject anyObject) {
-        return CollectionUtils.collect(findAllResources(anyObject), new Transformer<ExternalResource, String>() {
-
-            @Override
-            public String transform(final ExternalResource input) {
-                return input.getKey();
-            }
-        });
+        return CollectionUtils.collect(
+                findAllResources(anyObject), EntityUtils.<String, ExternalResource>keyTransformer());
     }
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/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 942b950..d414456 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
@@ -34,13 +34,13 @@ import javax.validation.ValidationException;
 import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
 import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.Transformer;
 import org.apache.commons.lang3.ClassUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
 import org.apache.syncope.core.misc.utils.RealmUtils;
+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.PlainSchemaDAO;
 import org.apache.syncope.core.persistence.api.dao.GroupDAO;
@@ -101,13 +101,8 @@ public class JPAAnySearchDAO extends AbstractDAO<Any<?>, Long> implements AnySea
             if (realm == null) {
                 LOG.warn("Ignoring invalid realm {}", realmPath);
             } else {
-                CollectionUtils.collect(realmDAO.findDescendants(realm), new Transformer<Realm, Long>() {
-
-                    @Override
-                    public Long transform(final Realm descendant) {
-                        return descendant.getKey();
-                    }
-                }, realmKeys);
+                CollectionUtils.collect(
+                        realmDAO.findDescendants(realm), EntityUtils.<Long, Realm>keyTransformer(), realmKeys);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyTypeClassDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyTypeClassDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyTypeClassDAO.java
index 7a32a18..8efb01f 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyTypeClassDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyTypeClassDAO.java
@@ -102,14 +102,14 @@ public class JPAAnyTypeClassDAO extends AbstractDAO<AnyTypeClass, String> implem
         }
 
         for (AnyType type : anyTypeDAO.findByTypeClass(anyTypeClass)) {
-            type.remove(anyTypeClass);
+            type.getClasses().remove(anyTypeClass);
         }
 
         for (TypeExtension typeExt : groupDAO.findTypeExtensionByAnyTypeClass(anyTypeClass)) {
-            typeExt.remove(anyTypeClass);
+            typeExt.getAuxClasses().remove(anyTypeClass);
 
             if (typeExt.getAuxClasses().isEmpty()) {
-                typeExt.getGroup().remove(typeExt);
+                typeExt.getGroup().getTypeExtensions().remove(typeExt);
                 typeExt.setGroup(null);
             }
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAConfDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAConfDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAConfDAO.java
index 985c7aa..2797847 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAConfDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAConfDAO.java
@@ -94,7 +94,7 @@ public class JPAConfDAO extends AbstractDAO<Conf, Long> implements ConfDAO {
         if (old != null && (!attr.getSchema().isUniqueConstraint()
                 || (!attr.getUniqueValue().getStringValue().equals(old.getUniqueValue().getStringValue())))) {
 
-            instance.remove(old);
+            instance.getPlainAttrs().remove(old);
             attrDAO.delete(old.getKey(), CPlainAttr.class);
         }
 
@@ -109,7 +109,7 @@ public class JPAConfDAO extends AbstractDAO<Conf, Long> implements ConfDAO {
         Conf instance = get();
         CPlainAttr attr = instance.getPlainAttr(key);
         if (attr != null) {
-            instance.remove(attr);
+            instance.getPlainAttrs().remove(attr);
             instance = entityManager().merge(instance);
         }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPADerSchemaDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPADerSchemaDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPADerSchemaDAO.java
index d09ae25..a0e5479 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPADerSchemaDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPADerSchemaDAO.java
@@ -83,7 +83,7 @@ public class JPADerSchemaDAO extends AbstractDAO<DerSchema, String> implements D
         }
 
         if (schema.getAnyTypeClass() != null) {
-            schema.getAnyTypeClass().remove(schema);
+            schema.getAnyTypeClass().getDerSchemas().remove(schema);
         }
 
         entityManager().remove(schema);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
index facea51..b270d8b 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
@@ -170,7 +170,7 @@ public class JPAExternalResourceDAO extends AbstractDAO<ExternalResource, String
         for (Long itemKey : itemKeys) {
             MappingItem item = entityManager().find(JPAMappingItem.class, itemKey);
             if (item != null) {
-                item.getMapping().remove(item);
+                item.getMapping().getItems().remove(item);
                 item.setMapping(null);
 
                 entityManager().remove(item);
@@ -194,16 +194,16 @@ public class JPAExternalResourceDAO extends AbstractDAO<ExternalResource, String
         taskDAO.deleteAll(resource, TaskType.PUSH);
 
         for (AnyObject anyObject : anyObjectDAO.findByResource(resource)) {
-            anyObject.remove(resource);
+            anyObject.getResources().remove(resource);
         }
         for (User user : userDAO.findByResource(resource)) {
-            user.remove(resource);
+            user.getResources().remove(resource);
         }
         for (Group group : groupDAO.findByResource(resource)) {
-            group.remove(resource);
+            group.getResources().remove(resource);
         }
         for (AccountPolicy policy : policyDAO.findByResource(resource)) {
-            policy.remove(resource);
+            policy.getResources().remove(resource);
         }
 
         for (Provision provision : resource.getProvisions()) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
index 9fae1d5..6c4815c 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
@@ -202,13 +202,13 @@ public class JPAGroupDAO extends AbstractAnyDAO<Group> implements GroupDAO {
     @Override
     public void delete(final Group group) {
         for (AMembership membership : findAMemberships(group)) {
-            membership.getLeftEnd().remove(membership);
+            membership.getLeftEnd().getMemberships().remove(membership);
             anyObjectDAO.save(membership.getLeftEnd());
 
             entityManager().remove(membership);
         }
         for (UMembership membership : findUMemberships(group)) {
-            membership.getLeftEnd().remove(membership);
+            membership.getLeftEnd().getMemberships().remove(membership);
             userDAO.save(membership.getLeftEnd());
 
             entityManager().remove(membership);
@@ -282,7 +282,7 @@ public class JPAGroupDAO extends AbstractAnyDAO<Group> implements GroupDAO {
 
                     memb.add(anyObject);
                 } else {
-                    memb.remove(anyObject);
+                    memb.getMembers().remove(anyObject);
                 }
             }
         }
@@ -300,7 +300,7 @@ public class JPAGroupDAO extends AbstractAnyDAO<Group> implements GroupDAO {
 
                     group.getUDynMembership().add(user);
                 } else {
-                    group.getUDynMembership().remove(user);
+                    group.getUDynMembership().getMembers().remove(user);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainAttrDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainAttrDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainAttrDAO.java
index 975b6e9..2afbe15 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainAttrDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainAttrDAO.java
@@ -41,12 +41,12 @@ public class JPAPlainAttrDAO extends AbstractDAO<PlainAttr<?>, Long> implements
         return CPlainAttr.class.isAssignableFrom(reference)
                 ? JPACPlainAttr.class
                 : GPlainAttr.class.isAssignableFrom(reference)
-                        ? JPAGPlainAttr.class
-                        : APlainAttr.class.isAssignableFrom(reference)
-                                ? JPAAPlainAttr.class
-                                : UPlainAttr.class.isAssignableFrom(reference)
-                                        ? JPAUPlainAttr.class
-                                        : null;
+                ? JPAGPlainAttr.class
+                : APlainAttr.class.isAssignableFrom(reference)
+                ? JPAAPlainAttr.class
+                : UPlainAttr.class.isAssignableFrom(reference)
+                ? JPAUPlainAttr.class
+                : null;
     }
 
     @Override
@@ -68,7 +68,7 @@ public class JPAPlainAttrDAO extends AbstractDAO<PlainAttr<?>, Long> implements
     @SuppressWarnings("unchecked")
     public <T extends PlainAttr<?>> void delete(final T plainAttr) {
         if (plainAttr.getOwner() != null) {
-            ((Any<T>) plainAttr.getOwner()).remove(plainAttr);
+            ((Any<T>) plainAttr.getOwner()).getPlainAttrs().remove(plainAttr);
         }
 
         entityManager().remove(plainAttr);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainAttrValueDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainAttrValueDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainAttrValueDAO.java
index 60f3786..4b414be 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainAttrValueDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainAttrValueDAO.java
@@ -52,22 +52,22 @@ public class JPAPlainAttrValueDAO extends AbstractDAO<PlainAttrValue, Long> impl
         return AbstractPlainAttrValue.class.isAssignableFrom(reference)
                 ? (Class<? extends AbstractPlainAttrValue>) reference
                 : reference.equals(CPlainAttrValue.class)
-                        ? JPACPlainAttrValue.class
-                        : reference.equals(CPlainAttrUniqueValue.class)
-                                ? JPACPlainAttrUniqueValue.class
-                                : reference.equals(GPlainAttrValue.class)
-                                        ? JPAGPlainAttrValue.class
-                                        : reference.equals(GPlainAttrUniqueValue.class)
-                                                ? JPAGPlainAttrUniqueValue.class
-                                                : reference.equals(APlainAttrValue.class)
-                                                        ? JPAAPlainAttrValue.class
-                                                        : reference.equals(APlainAttrUniqueValue.class)
-                                                                ? JPAAPlainAttrUniqueValue.class
-                                                                : reference.equals(UPlainAttrValue.class)
-                                                                        ? JPAUPlainAttrValue.class
-                                                                        : reference.equals(UPlainAttrUniqueValue.class)
-                                                                                ? JPAUPlainAttrUniqueValue.class
-                                                                                : null;
+                ? JPACPlainAttrValue.class
+                : reference.equals(CPlainAttrUniqueValue.class)
+                ? JPACPlainAttrUniqueValue.class
+                : reference.equals(GPlainAttrValue.class)
+                ? JPAGPlainAttrValue.class
+                : reference.equals(GPlainAttrUniqueValue.class)
+                ? JPAGPlainAttrUniqueValue.class
+                : reference.equals(APlainAttrValue.class)
+                ? JPAAPlainAttrValue.class
+                : reference.equals(APlainAttrUniqueValue.class)
+                ? JPAAPlainAttrUniqueValue.class
+                : reference.equals(UPlainAttrValue.class)
+                ? JPAUPlainAttrValue.class
+                : reference.equals(UPlainAttrUniqueValue.class)
+                ? JPAUPlainAttrUniqueValue.class
+                : null;
     }
 
     @Override
@@ -103,7 +103,7 @@ public class JPAPlainAttrValueDAO extends AbstractDAO<PlainAttrValue, Long> impl
             if (attrValue instanceof PlainAttrUniqueValue) {
                 attrValue.getAttr().setUniqueValue(null);
             } else {
-                attrValue.getAttr().remove(attrValue);
+                attrValue.getAttr().getValues().remove(attrValue);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainSchemaDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainSchemaDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainSchemaDAO.java
index fe9e573..61b3dbd 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainSchemaDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPlainSchemaDAO.java
@@ -73,11 +73,9 @@ public class JPAPlainSchemaDAO extends AbstractDAO<PlainSchema, String> implemen
 
     @Override
     public <T extends PlainAttr<?>> List<T> findAttrs(final PlainSchema schema, final Class<T> reference) {
-        StringBuilder queryString = new StringBuilder("SELECT e FROM ").
-                append(((JPAPlainAttrDAO) plainAttrDAO).getJPAEntityReference(reference).getSimpleName()).
-                append(" e WHERE e.schema=:schema");
-
-        TypedQuery<T> query = entityManager().createQuery(queryString.toString(), reference);
+        TypedQuery<T> query = entityManager().createQuery(
+                "SELECT e FROM " + ((JPAPlainAttrDAO) plainAttrDAO).getJPAEntityReference(reference).getSimpleName()
+                + " e WHERE e.schema=:schema", reference);
         query.setParameter("schema", schema);
 
         return query.getResultList();
@@ -107,7 +105,7 @@ public class JPAPlainSchemaDAO extends AbstractDAO<PlainSchema, String> implemen
         }
 
         if (schema.getAnyTypeClass() != null) {
-            schema.getAnyTypeClass().remove(schema);
+            schema.getAnyTypeClass().getPlainSchemas().remove(schema);
         }
 
         entityManager().remove(schema);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARelationshipTypeDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARelationshipTypeDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARelationshipTypeDAO.java
index 5eb3951..d662cd0 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARelationshipTypeDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARelationshipTypeDAO.java
@@ -76,13 +76,13 @@ public class JPARelationshipTypeDAO extends AbstractDAO<RelationshipType, String
 
         for (Relationship<?, ?> relationship : findRelationshipsByType(type)) {
             if (relationship instanceof URelationship) {
-                ((URelationship) relationship).getLeftEnd().remove((URelationship) relationship);
+                ((URelationship) relationship).getLeftEnd().getRelationships().remove((URelationship) relationship);
             } else if (relationship instanceof UMembership) {
-                ((UMembership) relationship).getLeftEnd().remove((UMembership) relationship);
+                ((UMembership) relationship).getLeftEnd().getMemberships().remove((UMembership) relationship);
             } else if (relationship instanceof ARelationship) {
-                ((ARelationship) relationship).getLeftEnd().remove((ARelationship) relationship);
+                ((ARelationship) relationship).getLeftEnd().getRelationships().remove((ARelationship) relationship);
             } else if (relationship instanceof AMembership) {
-                ((AMembership) relationship).getLeftEnd().remove((AMembership) relationship);
+                ((AMembership) relationship).getLeftEnd().getMemberships().remove((AMembership) relationship);
             }
 
             relationship.setLeftEnd(null);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAReportExecDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAReportExecDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAReportExecDAO.java
index dc72759..400f8a2 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAReportExecDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAReportExecDAO.java
@@ -117,7 +117,7 @@ public class JPAReportExecDAO extends AbstractDAO<ReportExec, Long> implements R
     @Override
     public void delete(final ReportExec execution) {
         if (execution.getReport() != null) {
-            execution.getReport().remove(execution);
+            execution.getReport().getExecs().remove(execution);
         }
 
         entityManager().remove(execution);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARoleDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARoleDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARoleDAO.java
index ea47cf8..19ee6d1 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARoleDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARoleDAO.java
@@ -82,7 +82,7 @@ public class JPARoleDAO extends AbstractDAO<Role, String> implements RoleDAO {
         query.setParameter("role", role);
 
         for (User user : query.getResultList()) {
-            user.remove(role);
+            user.getRoles().remove(role);
         }
 
         entityManager().remove(role);
@@ -108,7 +108,7 @@ public class JPARoleDAO extends AbstractDAO<Role, String> implements RoleDAO {
 
                     role.getDynMembership().add(user);
                 } else {
-                    role.getDynMembership().remove(user);
+                    role.getDynMembership().getMembers().remove(user);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskExecDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskExecDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskExecDAO.java
index d88a2cb..b44d4c7 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskExecDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskExecDAO.java
@@ -164,7 +164,7 @@ public class JPATaskExecDAO extends AbstractDAO<TaskExec, Long> implements TaskE
     @Transactional(rollbackFor = { Throwable.class })
     public void saveAndAdd(final Long taskId, final TaskExec execution) {
         Task task = taskDAO.find(taskId);
-        task.addExec(execution);
+        task.add(execution);
         taskDAO.save(task);
     }
 
@@ -181,7 +181,7 @@ public class JPATaskExecDAO extends AbstractDAO<TaskExec, Long> implements TaskE
     @Override
     public void delete(final TaskExec execution) {
         if (execution.getTask() != null) {
-            execution.getTask().removeExec(execution);
+            execution.getTask().getExecs().remove(execution);
         }
 
         entityManager().remove(execution);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
index a669e24..0bbe763 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
@@ -364,10 +364,10 @@ public class JPAUserDAO extends AbstractAnyDAO<User> implements UserDAO {
     @Override
     public void delete(final User user) {
         for (Role role : findDynRoleMemberships(user)) {
-            role.getDynMembership().remove(user);
+            role.getDynMembership().getMembers().remove(user);
         }
         for (Group group : findDynGroupMemberships(user)) {
-            group.getUDynMembership().remove(user);
+            group.getUDynMembership().getMembers().remove(user);
         }
 
         entityManager().remove(user);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAVirSchemaDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAVirSchemaDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAVirSchemaDAO.java
index dd77060..d9f5604 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAVirSchemaDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAVirSchemaDAO.java
@@ -62,11 +62,9 @@ public class JPAVirSchemaDAO extends AbstractDAO<VirSchema, String> implements V
 
     @Override
     public List<VirSchema> findByProvision(final Provision provision) {
-        StringBuilder queryString = new StringBuilder("SELECT e FROM ").
-                append(JPAVirSchema.class.getSimpleName()).
-                append(" e WHERE e.provision=:provision");
-
-        TypedQuery<VirSchema> query = entityManager().createQuery(queryString.toString(), VirSchema.class);
+        TypedQuery<VirSchema> query = entityManager().createQuery(
+                "SELECT e FROM " + JPAVirSchema.class.getSimpleName()
+                + " e WHERE e.provision=:provision", VirSchema.class);
         query.setParameter("provision", provision);
 
         return query.getResultList();
@@ -99,7 +97,7 @@ public class JPAVirSchemaDAO extends AbstractDAO<VirSchema, String> implements V
         }
 
         if (schema.getAnyTypeClass() != null) {
-            schema.getAnyTypeClass().remove(schema);
+            schema.getAnyTypeClass().getVirSchemas().remove(schema);
         }
 
         entityManager().remove(schema);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
index bb2b855..e6ead6f 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/AbstractAny.java
@@ -19,25 +19,18 @@
 package org.apache.syncope.core.persistence.jpa.entity;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
-import java.util.Set;
 import javax.persistence.Column;
 import javax.persistence.FetchType;
 import javax.persistence.ManyToOne;
 import javax.persistence.MappedSuperclass;
-import javax.persistence.Transient;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
-import org.apache.commons.collections4.Transformer;
+import org.apache.syncope.core.misc.utils.EntityUtils;
 import org.apache.syncope.core.persistence.api.entity.Any;
-import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
-import org.apache.syncope.core.persistence.api.entity.DerSchema;
 import org.apache.syncope.core.persistence.api.entity.PlainAttr;
-import org.apache.syncope.core.persistence.api.entity.PlainSchema;
 import org.apache.syncope.core.persistence.api.entity.Realm;
-import org.apache.syncope.core.persistence.api.entity.VirSchema;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.jpa.entity.resource.JPAExternalResource;
 import org.apache.syncope.core.persistence.jpa.validation.entity.AnyCheck;
@@ -58,15 +51,6 @@ public abstract class AbstractAny<P extends PlainAttr<?>>
     @Column(nullable = true)
     private String status;
 
-    @Transient
-    private Set<PlainSchema> allowedPlainSchemas;
-
-    @Transient
-    private Set<DerSchema> allowedDerSchemas;
-
-    @Transient
-    private Set<VirSchema> allowedVirSchemas;
-
     @Override
     public Realm getRealm() {
         return realm;
@@ -119,32 +103,13 @@ public abstract class AbstractAny<P extends PlainAttr<?>>
     }
 
     @Override
-    public boolean remove(final ExternalResource resource) {
-        checkType(resource, JPAExternalResource.class);
-        return internalGetResources().remove((JPAExternalResource) resource);
-    }
-
-    @Override
     public List<String> getResourceNames() {
-        return CollectionUtils.collect(getResources(), new Transformer<ExternalResource, String>() {
-
-            @Override
-            public String transform(final ExternalResource input) {
-                return input.getKey();
-            }
-        }, new ArrayList<String>());
+        return CollectionUtils.collect(
+                getResources(), EntityUtils.<String, ExternalResource>keyTransformer(), new ArrayList<String>());
     }
 
     @Override
     public List<? extends ExternalResource> getResources() {
         return internalGetResources();
     }
-
-    private void populateAllowedSchemas(final Collection<? extends AnyTypeClass> anyTypeClasses) {
-        for (AnyTypeClass anyTypeClass : anyTypeClasses) {
-            allowedPlainSchemas.addAll(anyTypeClass.getPlainSchemas());
-            allowedDerSchemas.addAll(anyTypeClass.getDerSchemas());
-            allowedVirSchemas.addAll(anyTypeClass.getVirSchemas());
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyType.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyType.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyType.java
index 8f99efc..64cd644 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyType.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyType.java
@@ -87,12 +87,6 @@ public class JPAAnyType extends AbstractEntity<String> implements AnyType {
     }
 
     @Override
-    public boolean remove(final AnyTypeClass anyTypeClass) {
-        checkType(anyTypeClass, JPAAnyTypeClass.class);
-        return this.classes.remove((JPAAnyTypeClass) anyTypeClass);
-    }
-
-    @Override
     public List<? extends AnyTypeClass> getClasses() {
         return classes;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyTypeClass.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyTypeClass.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyTypeClass.java
index 6a5e03e..b823f49 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyTypeClass.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyTypeClass.java
@@ -79,12 +79,6 @@ public class JPAAnyTypeClass extends AbstractEntity<String> implements AnyTypeCl
     }
 
     @Override
-    public boolean remove(final PlainSchema schema) {
-        checkType(schema, JPAPlainSchema.class);
-        return this.plainSchemas.remove((JPAPlainSchema) schema);
-    }
-
-    @Override
     public List<? extends PlainSchema> getPlainSchemas() {
         return plainSchemas;
     }
@@ -96,12 +90,6 @@ public class JPAAnyTypeClass extends AbstractEntity<String> implements AnyTypeCl
     }
 
     @Override
-    public boolean remove(final DerSchema schema) {
-        checkType(schema, JPADerSchema.class);
-        return this.derSchemas.remove((JPADerSchema) schema);
-    }
-
-    @Override
     public List<? extends DerSchema> getDerSchemas() {
         return derSchemas;
     }
@@ -113,12 +101,6 @@ public class JPAAnyTypeClass extends AbstractEntity<String> implements AnyTypeCl
     }
 
     @Override
-    public boolean remove(final VirSchema schema) {
-        checkType(schema, JPAVirSchema.class);
-        return this.virSchemas.remove((JPAVirSchema) schema);
-    }
-
-    @Override
     public List<? extends VirSchema> getVirSchemas() {
         return virSchemas;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAConnInstance.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAConnInstance.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAConnInstance.java
index e31aaaa..d59982e 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAConnInstance.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAConnInstance.java
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.core.persistence.jpa.entity;
 
-import org.apache.syncope.core.persistence.jpa.entity.resource.JPAExternalResource;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
@@ -46,6 +45,7 @@ import org.apache.syncope.core.persistence.api.entity.ConnPoolConf;
 import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 import org.apache.syncope.core.persistence.jpa.validation.entity.ConnInstanceCheck;
 import org.apache.syncope.core.misc.serialization.POJOHelper;
+import org.apache.syncope.core.persistence.jpa.entity.resource.JPAExternalResource;
 
 @Entity
 @Table(name = JPAConnInstance.TABLE)
@@ -211,12 +211,6 @@ public class JPAConnInstance extends AbstractEntity<Long> implements ConnInstanc
     }
 
     @Override
-    public boolean remove(final ExternalResource resource) {
-        checkType(resource, JPAExternalResource.class);
-        return this.resources.remove((JPAExternalResource) resource);
-    }
-
-    @Override
     public Set<ConnectorCapability> getCapabilities() {
         return capabilities;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
index 12555ea..8afba79 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
@@ -20,7 +20,6 @@ package org.apache.syncope.core.persistence.jpa.entity;
 
 import java.util.ArrayList;
 import java.util.List;
-
 import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.CollectionTable;
@@ -177,12 +176,6 @@ public class JPANotification extends AbstractEntity<Long> implements Notificatio
     }
 
     @Override
-    public boolean remove(final AnyAbout about) {
-        checkType(about, JPAAnyAbout.class);
-        return this.abouts.remove((JPAAnyAbout) about);
-    }
-
-    @Override
     public AnyAbout getAbout(final AnyType anyType) {
         return IterableUtils.find(abouts, new Predicate<AnyAbout>() {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARealm.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARealm.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARealm.java
index a784c68..5455168 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARealm.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARealm.java
@@ -153,12 +153,6 @@ public class JPARealm extends AbstractEntity<Long> implements Realm {
     }
 
     @Override
-    public boolean remove(final AnyTemplateRealm template) {
-        checkType(template, JPAAnyTemplateRealm.class);
-        return this.templates.remove((JPAAnyTemplateRealm) template);
-    }
-
-    @Override
     public AnyTemplateRealm 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/JPAReport.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAReport.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAReport.java
index 8cf3d57..835e108 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAReport.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAReport.java
@@ -89,12 +89,6 @@ public class JPAReport extends AbstractEntity<Long> implements Report {
     }
 
     @Override
-    public boolean remove(final ReportExec exec) {
-        checkType(exec, JPAReportExec.class);
-        return exec != null && executions.remove((JPAReportExec) exec);
-    }
-
-    @Override
     public List<? extends ReportExec> 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/JPARole.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARole.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARole.java
index 78d7380..d2c6dc0 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARole.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARole.java
@@ -96,12 +96,6 @@ public class JPARole extends AbstractEntity<String> implements Role {
     }
 
     @Override
-    public boolean remove(final Realm realm) {
-        checkType(realm, JPARealm.class);
-        return realms.remove((JPARealm) realm);
-    }
-
-    @Override
     public List<? extends Realm> getRealms() {
         return realms;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAADynGroupMembership.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAADynGroupMembership.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAADynGroupMembership.java
index 1d3d69e..b6ad613 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAADynGroupMembership.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAADynGroupMembership.java
@@ -94,12 +94,6 @@ public class JPAADynGroupMembership extends AbstractDynMembership<AnyObject> imp
     }
 
     @Override
-    public boolean remove(final AnyObject anyObject) {
-        checkType(anyObject, JPAAnyObject.class);
-        return anyObjects.remove((JPAAnyObject) anyObject);
-    }
-
-    @Override
     public List<? extends AnyObject> getMembers() {
         return anyObjects;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAPlainAttr.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAPlainAttr.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAPlainAttr.java
index 46c1680..d0abc91 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAPlainAttr.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAPlainAttr.java
@@ -82,12 +82,6 @@ public class JPAAPlainAttr extends AbstractPlainAttr<AnyObject> implements APlai
     }
 
     @Override
-    public boolean remove(final PlainAttrValue attrValue) {
-        checkType(attrValue, JPAAPlainAttrValue.class);
-        return values.remove((JPAAPlainAttrValue) attrValue);
-    }
-
-    @Override
     public List<? extends APlainAttrValue> 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/anyobject/JPAAnyObject.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAnyObject.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAnyObject.java
index 955d168..304956e 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAnyObject.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/anyobject/JPAAnyObject.java
@@ -114,12 +114,6 @@ public class JPAAnyObject extends AbstractAny<APlainAttr> implements AnyObject {
     }
 
     @Override
-    public boolean remove(final APlainAttr attr) {
-        checkType(attr, JPAAPlainAttr.class);
-        return plainAttrs.remove((JPAAPlainAttr) attr);
-    }
-
-    @Override
     public List<? extends APlainAttr> getPlainAttrs() {
         return plainAttrs;
     }
@@ -136,12 +130,6 @@ public class JPAAnyObject extends AbstractAny<APlainAttr> implements AnyObject {
     }
 
     @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;
     }
@@ -153,12 +141,6 @@ public class JPAAnyObject extends AbstractAny<APlainAttr> implements AnyObject {
     }
 
     @Override
-    public boolean remove(final ARelationship relationship) {
-        checkType(relationship, JPAARelationship.class);
-        return this.relationships.remove((JPAARelationship) relationship);
-    }
-
-    @Override
     public ARelationship getRelationship(final RelationshipType relationshipType, final Long anyObjectKey) {
         return IterableUtils.find(getRelationships(), new Predicate<ARelationship>() {
 
@@ -205,12 +187,6 @@ public class JPAAnyObject extends AbstractAny<APlainAttr> implements AnyObject {
     }
 
     @Override
-    public boolean remove(final AMembership membership) {
-        checkType(membership, JPAAMembership.class);
-        return this.memberships.remove((JPAAMembership) membership);
-    }
-
-    @Override
     public AMembership getMembership(final Long groupKey) {
         return IterableUtils.find(getMemberships(), new Predicate<AMembership>() {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPACPlainAttr.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPACPlainAttr.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPACPlainAttr.java
index b6b683b..270fa8b 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPACPlainAttr.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPACPlainAttr.java
@@ -111,12 +111,6 @@ public class JPACPlainAttr extends AbstractPlainAttr<Conf> implements CPlainAttr
     }
 
     @Override
-    public boolean remove(final PlainAttrValue attrValue) {
-        checkType(attrValue, JPACPlainAttrValue.class);
-        return values.remove((JPACPlainAttrValue) attrValue);
-    }
-
-    @Override
     public List<? extends CPlainAttrValue> 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/conf/JPAConf.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
index 48453ca..7347fbb 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/conf/JPAConf.java
@@ -71,12 +71,6 @@ public class JPAConf extends AbstractAnnotatedEntity<Long> implements Conf {
     }
 
     @Override
-    public boolean remove(final CPlainAttr attr) {
-        checkType(attr, JPACPlainAttr.class);
-        return plainAttrs.remove((JPACPlainAttr) attr);
-    }
-
-    @Override
     public CPlainAttr getPlainAttr(final String plainSchemaName) {
         return IterableUtils.find(plainAttrs, new Predicate<CPlainAttr>() {
 
@@ -99,11 +93,6 @@ public class JPAConf extends AbstractAnnotatedEntity<Long> implements Conf {
     }
 
     @Override
-    public boolean remove(final ExternalResource resource) {
-        return false;
-    }
-
-    @Override
     public List<String> getResourceNames() {
         return Collections.emptyList();
     }
@@ -119,11 +108,6 @@ public class JPAConf extends AbstractAnnotatedEntity<Long> implements Conf {
     }
 
     @Override
-    public boolean remove(final AnyTypeClass auxClass) {
-        return false;
-    }
-
-    @Override
     public List<? extends AnyTypeClass> getAuxClasses() {
         return Collections.emptyList();
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGPlainAttr.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGPlainAttr.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGPlainAttr.java
index daafd08..1090351 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGPlainAttr.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGPlainAttr.java
@@ -82,12 +82,6 @@ public class JPAGPlainAttr extends AbstractPlainAttr<Group> implements GPlainAtt
     }
 
     @Override
-    public boolean remove(final PlainAttrValue attrValue) {
-        checkType(attrValue, JPAGPlainAttrValue.class);
-        return values.remove((JPAGPlainAttrValue) attrValue);
-    }
-
-    @Override
     public List<? extends GPlainAttrValue> 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/group/JPAGroup.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGroup.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGroup.java
index bd3cbce..7444bd3 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGroup.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPAGroup.java
@@ -166,12 +166,6 @@ public class JPAGroup extends AbstractAny<GPlainAttr> implements Group {
     }
 
     @Override
-    public boolean remove(final GPlainAttr attr) {
-        checkType(attr, JPAGPlainAttr.class);
-        return plainAttrs.remove((JPAGPlainAttr) attr);
-    }
-
-    @Override
     public List<? extends GPlainAttr> getPlainAttrs() {
         return plainAttrs;
     }
@@ -194,12 +188,6 @@ public class JPAGroup extends AbstractAny<GPlainAttr> implements Group {
     }
 
     @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;
     }
@@ -211,12 +199,6 @@ public class JPAGroup extends AbstractAny<GPlainAttr> implements Group {
     }
 
     @Override
-    public boolean remove(final ADynGroupMembership dynGroupMembership) {
-        checkType(dynGroupMembership, JPAADynGroupMembership.class);
-        return this.aDynMemberships.remove((JPAADynGroupMembership) dynGroupMembership);
-    }
-
-    @Override
     public ADynGroupMembership getADynMembership(final AnyType anyType) {
         return IterableUtils.find(aDynMemberships, new Predicate<ADynGroupMembership>() {
 
@@ -239,12 +221,6 @@ public class JPAGroup extends AbstractAny<GPlainAttr> implements Group {
     }
 
     @Override
-    public boolean remove(final TypeExtension typeExtension) {
-        checkType(typeExtension, JPATypeExtension.class);
-        return this.typeExtensions.remove((JPATypeExtension) typeExtension);
-    }
-
-    @Override
     public TypeExtension getTypeExtension(final AnyType anyType) {
         return IterableUtils.find(typeExtensions, new Predicate<TypeExtension>() {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6d56c7ed/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPATypeExtension.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPATypeExtension.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPATypeExtension.java
index 7d244da..9510c23 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPATypeExtension.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/group/JPATypeExtension.java
@@ -96,12 +96,6 @@ public class JPATypeExtension extends AbstractEntity<Long> implements TypeExtens
     }
 
     @Override
-    public boolean remove(final AnyTypeClass auxClass) {
-        checkType(auxClass, JPAAnyTypeClass.class);
-        return auxClasses.remove((JPAAnyTypeClass) auxClass);
-    }
-
-    @Override
     public List<? extends AnyTypeClass> getAuxClasses() {
         return auxClasses;
     }


Mime
View raw message