Interface CrudMethods
- All Known Implementing Classes:
DefaultCrudMethods
public interface CrudMethods
Meta-information about the CRUD methods of a repository.
- Since:
- 1.6
- Author:
- Oliver Gierke
-
Method Summary
Modifier and TypeMethodDescriptionReturns the delete method of the repository.Returns the find all method of the repository.Returns the find one method of the repository.Returns the method to be used for saving entities.boolean
Returns whether the repository exposes a delete method.boolean
Returns whether the repository exposes a find all method at all.boolean
Returns whether the repository exposes a find one method.boolean
Returns whether the repository exposes a save method at all.
-
Method Details
-
getSaveMethod
Returns the method to be used for saving entities. Usually signature compatible toCrudRepository.save(Object)
.- Returns:
- the method to save entities or
Optional.empty()
if none exposed. - See Also:
-
hasSaveMethod
boolean hasSaveMethod()Returns whether the repository exposes a save method at all.- Returns:
-
getFindAllMethod
Returns the find all method of the repository. Implementations should prefer more detailed methods likePagingAndSortingRepository
's taking aPageable
orSort
instance.- Returns:
- the find all method of the repository or
Optional.empty()
if not available. - See Also:
-
hasFindAllMethod
boolean hasFindAllMethod()Returns whether the repository exposes a find all method at all.- Returns:
-
getFindOneMethod
Returns the find one method of the repository. Usually signature compatible toCrudRepository.findById(Object)
- Returns:
- the find one method of the repository or
Optional.empty()
if not available. - See Also:
-
hasFindOneMethod
boolean hasFindOneMethod()Returns whether the repository exposes a find one method.- Returns:
-
getDeleteMethod
Returns the delete method of the repository. Will prefer a delete-by-entity method over a delete-by-id method.- Returns:
- the delete method of the repository or
Optional.empty()
if not available. - See Also:
-
hasDelete
boolean hasDelete()Returns whether the repository exposes a delete method.- Returns:
-