Interface DataBaseRestServiceTemplate<T,I extends Serializable>
public interface DataBaseRestServiceTemplate<T,I extends Serializable>
Client side interface for generic CRUD operations on a repository for a specific type.
- Author:
- Manfred Tremmel
-
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes the entity with the given id.voidDeletes all entities managed by the repository.findAll()Returns all instances of the type.Returns all instances of the type of named page.Returns all instances of the type of named page.Returns all instances of the type of named page.Returns all instances of the type of named page.Retrieves an entity by its id.Saves all given entities.Saves a given entity.
-
Method Details
-
save
Saves a given entity. Use the returned instance for further operations as the save operation might have changed the entity instance completely.- Parameters:
entity- to save- Returns:
- the saved entity
-
save
Saves all given entities.- Parameters:
entities- list of entities to save- Returns:
- the saved entities
- Throws:
IllegalArgumentException- in case the given entity is null.
-
findOne
Retrieves an entity by its id.- Parameters:
id- must not be null.- Returns:
- the entity with the given id or null if none found
- Throws:
IllegalArgumentException- ifidis null
-
findAll
Returns all instances of the type.- Returns:
- all entities
-
findAll
Returns all instances of the type of named page.- Parameters:
page- page number- Returns:
- all entities
-
findAll
Returns all instances of the type of named page.- Parameters:
page- page numbersize- size of a page- Returns:
- all entities
-
findAll
Returns all instances of the type of named page.- Parameters:
page- page numbersort- sorting of the result- Returns:
- all entities
-
findAll
Returns all instances of the type of named page.- Parameters:
page- page numbersize- size of a pagesort- sorting of the result- Returns:
- all entities
-
delete
Deletes the entity with the given id.- Parameters:
id- must not be null.- Throws:
IllegalArgumentException- in case the givenidis null
-
deleteAll
void deleteAll()Deletes all entities managed by the repository.
-