/** * Deletes the value of a property. * * @param entity Type of the entity to edit * @param propertyType Class of the property to delete */ default <T> Ack deleteProperty(ProjectEntity entity, Class<? extends PropertyType<T>> propertyType) { return deleteProperty(entity, propertyType.getName()); }
@Override public void deleteTargetItem(Property<?> targetProperty) { propertyService.deleteProperty(target, targetProperty.getType().getTypeName()); }
private <C extends UserPasswordConfiguration<C>, T extends ConfigurationProperty<C>> void cleanupType(PropertyType<T> propertyType, String configurationName) { //noinspection unchecked propertyService // Looks for all entities which have a property pointing to this configuration .searchWithPropertyValue( (Class<? extends PropertyType<T>>) propertyType.getClass(), (entityType, id) -> entityType.getEntityFn(structureService).apply(id), property -> StringUtils.equals(property.getConfiguration().getName(), configurationName) ) // Deleting this property .forEach(projectEntity -> propertyService.deleteProperty(projectEntity, propertyType.getTypeName())); } }