DTO - The EntityDTO this service operatespublic interface CRUDService<DTO extends EntityDTO,D extends EntityData<DTO>,DP> extends Service
| Modifier and Type | Method and Description |
|---|---|
D |
getData(java.lang.Long id)
Returns data for details of the given entity
|
D |
getDataForNew(DP params)
Returns data for a new entity with the given context parameters
|
DTO |
load(java.lang.Long id)
Loads a DTO for the entity with the given id, ensuring that the logged user can see the record
|
void |
remove(java.lang.Long id)
Removes the entity associated with the given identifier
|
void |
removeAll(java.util.Collection<java.lang.Long> ids)
Removes the entities associated with the given identifiers
|
java.lang.Long |
save(DTO object)
Saves the given object, returning the generated identifier
|
D getData(java.lang.Long id) throws FrameworkException
EntityNotFoundException - When the given id is not valid (or represents a not visible entity)FrameworkExceptionD getDataForNew(DP params) throws FrameworkException
FrameworkExceptionDTO load(java.lang.Long id) throws FrameworkException
EntityNotFoundException - When the entity with the given id was not found (or not visible)FrameworkExceptionvoid remove(java.lang.Long id)
throws FrameworkException
EntityNotFoundException - When the given id is not valid (or represents a not visible entity)ConstraintViolatedOnRemoveException - When the given id represents an entity which is referenced by other
entities, and the
delete is not cascaded to themFrameworkExceptionvoid removeAll(java.util.Collection<java.lang.Long> ids)
throws FrameworkException
EntityNotFoundException - When any of the given ids are not valid (or represents not visible entities)ConstraintViolatedOnRemoveException - When any of the given ids represents an entity which is referenced by
other entities, and the
delete is not cascaded to themFrameworkExceptionjava.lang.Long save(DTO object) throws FrameworkException
EntityNotFoundException - When the given id is not valid (or represents a not visible entity)ValidationException - When the given object has invalid fieldsDataAccessException - When a data access error prevented the object of being savedFrameworkException