public class CrudRepositorySupport extends Object implements DataStoreAware, RepositoryMetadataAware, KeyGeneratorAware<Object>
CrudRepository interface.| Modifier | Constructor and Description |
|---|---|
protected |
CrudRepositorySupport() |
| Modifier and Type | Method and Description |
|---|---|
protected DataStore |
getDataStore() |
protected KeyGenerator<?> |
getKeyGenerator() |
protected RepositoryMetadata |
getRepositoryMetadata() |
Object |
insert(Object entity)
Inserts the given entity via the
save(Object) method. |
Iterable<Object> |
save(Iterable entities)
Saves all the given entities
|
Object |
save(Object entity)
Saves the entity in the underlying data store, creating keys in the process, if necessary.
|
void |
setDataStore(DataStore dataStore) |
void |
setKeyGenerator(KeyGenerator<?> keyGenerator) |
void |
setRepositoryMetadata(RepositoryMetadata repositoryMetadata) |
public Object save(Object entity)
entity - the entity to savepublic Iterable<Object> save(Iterable entities)
entities - entities to save (insert or update)public Object insert(Object entity)
save(Object) method.entity - the entity to be inserted.protected KeyGenerator<?> getKeyGenerator()
public final void setKeyGenerator(KeyGenerator<?> keyGenerator)
setKeyGenerator in interface KeyGeneratorAware<Object>protected DataStore getDataStore()
public final void setDataStore(DataStore dataStore)
setDataStore in interface DataStoreAwareprotected RepositoryMetadata getRepositoryMetadata()
public final void setRepositoryMetadata(RepositoryMetadata repositoryMetadata)
setRepositoryMetadata in interface RepositoryMetadataAwareCopyright © 2014–2021. All rights reserved.