/** * <p> * Updated the common properties for a specific {@link IdentityType} instance from another instance. * </p> * * @param fromIdentityType * @param toIdentityType */ private void updateCommonProperties(IdentityType fromIdentityType, IdentityType toIdentityType) { toIdentityType.setEnabled(fromIdentityType.isEnabled()); toIdentityType.setCreatedDate(fromIdentityType.getCreatedDate()); toIdentityType.setExpirationDate(fromIdentityType.getExpirationDate()); for (Object object : toIdentityType.getAttributes().toArray()) { Attribute<? extends Serializable> attribute = (Attribute<? extends Serializable>) object; toIdentityType.removeAttribute(attribute.getName()); } for (Attribute<? extends Serializable> attrib : fromIdentityType.getAttributes()) { toIdentityType.setAttribute(attrib); } }
private void updateAttributes(IdentityType identityType, Object identity) { EntityManager em = getEntityManager(); if (identityType.getAttributes() != null && !identityType.getAttributes().isEmpty()) { List<String> attributesToRetain = new ArrayList<String>(); for (Attribute<? extends Serializable> userAttribute : identityType.getAttributes()) { attributesToRetain.add(userAttribute.getName());
Collection<Attribute<? extends Serializable>> allAttributes = updatedIdentityTypeInstance.getAttributes();