public class DefaultCrudMethods extends Object implements CrudMethods
RepositoryMetadata. Will detect methods
exposed in CrudRepository but also hand crafted CRUD methods that are signature compatible with the ones on
CrudRepository.| Constructor and Description |
|---|
DefaultCrudMethods(RepositoryMetadata metadata)
Creates a new
DefaultCrudMethods using the given RepositoryMetadata. |
| Modifier and Type | Method and Description |
|---|---|
Optional<Method> |
getDeleteMethod()
Returns the delete method of the repository.
|
Optional<Method> |
getFindAllMethod()
Returns the find all method of the repository.
|
Optional<Method> |
getFindOneMethod()
Returns the find one method of the repository.
|
Optional<Method> |
getSaveMethod()
Returns the method to be used for saving entities.
|
boolean |
hasDelete()
Returns whether the repository exposes a delete method.
|
boolean |
hasFindAllMethod()
Returns whether the repository exposes a find all method at all.
|
boolean |
hasFindOneMethod()
Returns whether the repository exposes a find one method.
|
boolean |
hasSaveMethod()
Returns whether the repository exposes a save method at all.
|
public DefaultCrudMethods(RepositoryMetadata metadata)
DefaultCrudMethods using the given RepositoryMetadata.metadata - must not be null.public Optional<Method> getSaveMethod()
CrudMethodsCrudRepository.save(Object).getSaveMethod in interface CrudMethodsOptional.empty() if none exposed.CrudMethods.hasSaveMethod()public boolean hasSaveMethod()
CrudMethodshasSaveMethod in interface CrudMethodspublic Optional<Method> getFindAllMethod()
CrudMethodsPagingAndSortingRepository's taking a Pageable or Sort instance.getFindAllMethod in interface CrudMethodsOptional.empty() if not available.CrudMethods.hasFindAllMethod()public boolean hasFindAllMethod()
CrudMethodshasFindAllMethod in interface CrudMethodspublic Optional<Method> getFindOneMethod()
CrudMethodsCrudRepository.findById(Object)getFindOneMethod in interface CrudMethodsOptional.empty() if not available.CrudMethods.hasFindOneMethod()public boolean hasFindOneMethod()
CrudMethodshasFindOneMethod in interface CrudMethodspublic boolean hasDelete()
CrudMethodshasDelete in interface CrudMethodspublic Optional<Method> getDeleteMethod()
CrudMethodsgetDeleteMethod in interface CrudMethodsOptional.empty() if not available.CrudMethods.hasDelete()Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.