Пример #1
0
 /**
  * Updates the given entity
  *
  * @param entity The entity to update
  * @return True if the entity saved without issue. False + Error message otherwise
  */
 public BooleanResponse update(T entity) {
   try {
     manager.update(entity);
     return new BooleanResponse(true);
   } catch (EntityValidationException e) {
     return new BooleanResponse(e.getMessage());
   }
 }
Пример #2
0
 /**
  * Creates a new entity response for the given Entity Validation Exception
  *
  * @param e The Entity Validation Exception to create the response for
  * @return The entity response
  */
 protected <R> EntityResponse<R> createEntityResponseError(EntityValidationException e) {
   return new EntityResponse<R>(null, e.getMessage());
 }