Interface WriterRepository<E,ID>
-
- Type Parameters:
E- Concrete type of the entity to be managed by the repository.ID- Concrete type of the entity's id.
- All Known Subinterfaces:
BasicRepository<E,ID>
public interface WriterRepository<E,ID>Interface for a repository with writing operations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <S extends E>
voiddelete(S entity)Deletes the givenentity.voiddeleteAll()Deletes all the entities in the repository.voiddeleteById(ID id)Deletes the entity with the givenid.<S extends E>
Ssave(S entity)Saves the givenentity.
-
-
-
Method Detail
-
save
<S extends E> S save(S entity) throws java.lang.IllegalArgumentException
Saves the givenentity. Use the returned entity instance for further operation.- Type Parameters:
S- Concrete type of the entity.- Parameters:
entity- The entity to be saved.- Returns:
- The saved instance.
- Throws:
java.lang.IllegalArgumentException- If the givenentityisnull.
-
delete
<S extends E> void delete(S entity) throws java.lang.IllegalArgumentException
Deletes the givenentity.- Type Parameters:
S- Concrete type of the entity.- Parameters:
entity- The entity to be deleted.- Throws:
java.lang.IllegalArgumentException- If the givenentityisnull.
-
deleteById
void deleteById(ID id) throws java.lang.IllegalArgumentException
Deletes the entity with the givenid.- Parameters:
id- The id of the entity to be deleted.- Throws:
java.lang.IllegalArgumentException- If the givenidisnull.
-
deleteAll
void deleteAll()
Deletes all the entities in the repository.
-
-