- /**
- * Whether the entities specific collection changed
- *
- * @param newEntity
- * @return
- */
- private boolean hasCollectionChanged(ENTITY newEntity){
-
- // return true on null
- if(getEntity() == null || newEntity == null) return true;
-
- // if the entities differ the collection has changed
- if(! getEntity().equals(newEntity)) return true;
-
- Collection<ELEMENT> oldCollection = getCollection(getEntity());
- Collection<ELEMENT> newCollection = getCollection(newEntity);
-
- // return true on null
- if(oldCollection == null || newCollection == null) return true;
-
- // if the collections are object equal, check if the content is equal, too
- if(oldCollection.equals(newCollection)){
-
- boolean equal = CollectionUtils.isEqualCollection(oldCollection, newCollection);
- // return true when collections are not equal
- return equal ? false : true;
- }
- return true;
- }
-