Interface ListCrudRepository<T,ID>
- All Superinterfaces:
CrudRepository<T,
,ID> Repository<T,
ID>
Interface for generic CRUD operations on a repository for a specific type. This an extension to
CrudRepository
returning List
instead of Iterable
where applicable.- Since:
- 3.0
- Author:
- Jens Schauder
- See Also:
-
Method Summary
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
-
Method Details
-
saveAll
Saves all given entities.- Specified by:
saveAll
in interfaceCrudRepository<T,
ID> - Parameters:
entities
- must not be null nor must it contain null.- Returns:
- the saved entities; will never be null. The returned Iterable will have the same size as the Iterable passed as an argument.
- Throws:
IllegalArgumentException
- in case the givenentities
or one of its entities is null.OptimisticLockingFailureException
- when at least one entity uses optimistic locking and has a version attribute with a different value from that found in the persistence store. Also thrown if at least one entity is assumed to be present but does not exist in the database.
-
findAll
Returns all instances of the type.- Specified by:
findAll
in interfaceCrudRepository<T,
ID> - Returns:
- all entities
-
findAllById
Returns all instances of the typeT
with the given IDs.If some or all ids are not found, no entities are returned for these IDs.
Note that the order of elements in the result is not guaranteed.
- Specified by:
findAllById
in interfaceCrudRepository<T,
ID> - Parameters:
ids
- must not be null nor contain any null values.- Returns:
- guaranteed to be not null. The size can be equal or less than the number of given ids.
- Throws:
IllegalArgumentException
- in case the givenids
or one of its items is null.
-