List of usage examples for org.springframework.data.repository.support RepositoryInvoker invokeSave
<T> T invokeSave(T object);
From source file:org.lightadmin.core.web.RepositoryFilePropertyController.java
@RequestMapping(value = BASE_MAPPING + "/file", method = DELETE) public ResponseEntity<?> deleteFileOfPropertyOfEntity(RootResourceInformation repoRequest, @BackendId Serializable id, @PathVariable String property) throws Exception { PersistentEntity<?, ?> persistentEntity = repoRequest.getPersistentEntity(); RepositoryInvoker invoker = repoRequest.getInvoker(); Object domainObj = invoker.invokeFindOne(id); if (null == domainObj) { throw new ResourceNotFoundException(); }// w w w. j a v a 2 s . co m PersistentProperty<?> prop = persistentEntity.getPersistentProperty(property); if (null == prop) { throw new ResourceNotFoundException(); } if (!isOfFileType(prop)) { return toEmptyResponse(METHOD_NOT_ALLOWED); } fileResourceStorage().delete(domainObj, prop); invoker.invokeSave(domainObj); return toEmptyResponse(OK); }