Package io.ran
Class CrudRepositoryTestDoubleBase<T,K>
java.lang.Object
io.ran.CrudRepositoryTestDoubleBase<T,K>
- All Implemented Interfaces:
CrudRepository<T,K>
public abstract class CrudRepositoryTestDoubleBase<T,K>
extends Object
implements CrudRepository<T,K>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.ran.CrudRepository
CrudRepository.CrudUpdateResult, CrudRepository.InlineQuery<T,Q extends CrudRepository.InlineQuery<T, Q>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected GenericFactoryprotected MappingHelperprotected final TestDoubleDbprotected TypeDescriber<T> -
Constructor Summary
ConstructorsConstructorDescriptionCrudRepositoryTestDoubleBase(GenericFactory genericFactory, Class<T> modelType, Class<K> keyType, MappingHelper mappingHelper, TestDoubleDb store) -
Method Summary
Modifier and TypeMethodDescriptiondeleteById(K k) Delete an instance of the entity by its id (primary key).deleteByIds(Collection<K> k) Delete all instances of the entity which has an id (primary key) in the given collection.Get an instance of the entity by its id (primary key).getAll()Get all instances of the entity, as a stream.Insert a new instance of the entity or update an existing one.protected <Z> CrudRepository.CrudUpdateResult
-
Field Details
-
store
-
genericFactory
-
modelType
-
keyType
-
typeDescriber
-
mappingHelper
-
-
Constructor Details
-
CrudRepositoryTestDoubleBase
public CrudRepositoryTestDoubleBase(GenericFactory genericFactory, Class<T> modelType, Class<K> keyType, MappingHelper mappingHelper, TestDoubleDb store)
-
-
Method Details
-
get
Description copied from interface:CrudRepositoryGet an instance of the entity by its id (primary key).Note: If the entity does not have a primary key, this method will not be available.
In case of compound primary key, pass the model object with the primary key fields populated.
- Specified by:
getin interfaceCrudRepository<T,K> - Parameters:
k- the id of the entity- Returns:
- an optional containing the entity if it exists
-
getAll
Description copied from interface:CrudRepositoryGet all instances of the entity, as a stream.- Specified by:
getAllin interfaceCrudRepository<T,K> - Returns:
- an unordered stream of all instances of the entity
-
deleteById
Description copied from interface:CrudRepositoryDelete an instance of the entity by its id (primary key).Note: If the entity does not have a primary key, this method will not be available.
In case of compound primary key, pass the model object with the primary key fields populated.
- Specified by:
deleteByIdin interfaceCrudRepository<T,K> - Parameters:
k- the id of the entity to be deleted- Returns:
- the result of the delete operation
-
deleteByIds
Description copied from interface:CrudRepositoryDelete all instances of the entity which has an id (primary key) in the given collection.Note: If the entity does not have a primary key, this method will not be available.
In case of compound primary key, pass the model object with the primary key fields populated.
- Specified by:
deleteByIdsin interfaceCrudRepository<T,K> - Parameters:
k- a collection of ids to be deleted- Returns:
- the result of the delete operation
-
save
Description copied from interface:CrudRepositoryInsert a new instance of the entity or update an existing one. Will match by primary key, but not other unique keys.- Specified by:
savein interfaceCrudRepository<T,K> - Parameters:
t- the entity to save- Returns:
- the result of the save operation
-
save
-