public class DefaultCrudRepository extends CrudRepositorySupport
CrudRepository.| Constructor and Description |
|---|
DefaultCrudRepository() |
| Modifier and Type | Method and Description |
|---|---|
Iterable |
delete(Iterable entities)
Deletes all specified entities from the data store.
|
Object |
delete(Object id)
Deletes the entity with the given id and returns the actual entity that was just deleted.
|
Iterable |
deleteAll()
Deletes everything from the data store
|
Object |
deleteById(Object entity)
Deletes the entity matching this entity's key from the data store
|
boolean |
existsById(Object key)
Checks whether the given key represents an entity in the data store
|
Iterable |
findAllById(Iterable ids)
Finds all the entities that match the given set of ids
|
Optional<Object> |
findById(Object key)
Finds the entity that was saved with this key, or returns null
|
Iterable<Object> |
saveAll(Iterable entities)
Saves all the given entities
|
getDataStore, getKeyGenerator, getRepositoryMetadata, insert, save, save, setDataStore, setKeyGenerator, setRepositoryMetadatapublic Iterable<Object> saveAll(Iterable entities)
entities - entities to save (insert or update)public Optional<Object> findById(Object key)
key - the keypublic boolean existsById(Object key)
key - the keypublic Iterable findAllById(Iterable ids)
ids - ids to look forpublic Object deleteById(Object entity)
entity - the entityEntityMissingKeyException - if the passed entity doesn't have a keypublic Object delete(Object id)
id - the idpublic Iterable delete(Iterable entities)
entities - the entities to deletepublic Iterable deleteAll()
Copyright © 2014–2021. All rights reserved.