*/
@Override
public boolean onDelete(Serializable id, E entity,JpaSupportRepository<E, ID> persistentContext) {
Class<?> entityClass = ReflectionUtils.getTargetClass(entity);
StateDelete stateDelete = ReflectionUtils.getAnnotation(entityClass,StateDelete.class);
if (stateDelete == null) {
return Boolean.TRUE;
}
Object value = ConvertUtils.convertToObject(stateDelete.value(), stateDelete.type().getValue());
ReflectionUtils.invokeSetterMethod(entity, stateDelete.propertyName(), value);
persistentContext.save(entity);
return Boolean.FALSE;
}