use of org.apache.syncope.core.persistence.jpa.entity.JPAAnyUtilsFactory in project syncope by apache.
the class JPAPlainSchemaDAO method delete.
@Override
public void delete(final String key) {
PlainSchema schema = find(key);
if (schema == null) {
return;
}
AnyUtilsFactory anyUtilsFactory = new JPAAnyUtilsFactory();
for (AnyTypeKind anyTypeKind : AnyTypeKind.values()) {
AnyUtils anyUtils = anyUtilsFactory.getInstance(anyTypeKind);
for (PlainAttr<?> attr : findAttrs(schema, anyUtils.plainAttrClass())) {
plainAttrDAO.delete(attr.getKey(), anyUtils.plainAttrClass());
}
resourceDAO().deleteMapping(key);
}
if (schema.getAnyTypeClass() != null) {
schema.getAnyTypeClass().getPlainSchemas().remove(schema);
}
entityManager().remove(schema);
}
Aggregations