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:
saveAllin 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 givenentitiesor 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:
findAllin interfaceCrudRepository<T,ID> - Returns:
- all entities
-
findAllById
Returns all instances of the typeTwith 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:
findAllByIdin 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 givenidsor one of its items is null.
-