|
Spring Data Commmons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Repository<T,ID extends Serializable>
Interface for generic CRUD operations on a repository for a specific type.
| Method Summary | |
|---|---|
Long |
count()
Returns the number of entities available. |
void |
delete(Iterable<? extends T> entities)
Deletes the given entities. |
void |
delete(T entity)
Deletes a given entity. |
void |
deleteAll()
Deletes all entities managed by the repository. |
boolean |
exists(ID id)
Returns whether an entity with the given id exists. |
List<T> |
findAll()
Returns all instances of the type. |
T |
findById(ID id)
Retrives an entity by its primary key. |
List<T> |
save(Iterable<? extends T> entities)
Saves all given entities. |
T |
save(T entity)
Saves a given entity. |
| Method Detail |
|---|
T save(T entity)
entity -
List<T> save(Iterable<? extends T> entities)
entities -
T findById(ID id)
id -
null if none
found
IllegalArgumentException - if primaryKey is nullboolean exists(ID id)
id -
IllegalArgumentException - if primaryKey is nullList<T> findAll()
Long count()
void delete(T entity)
entity - void delete(Iterable<? extends T> entities)
entities - void deleteAll()
|
Spring Data Commmons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||