Package org.stubit.springdata
Class RepositoryStub<T,ID>
java.lang.Object
org.stubit.springdata.RepositoryStub<T,ID>
- All Implemented Interfaces:
org.springframework.data.repository.Repository<T,
ID>
- Direct Known Subclasses:
CrudRepositoryStub
@NullMarked
public abstract class RepositoryStub<T,ID>
extends Object
implements org.springframework.data.repository.Repository<T,ID>
Simple abstract
Repository
stub implementation using a ConcurrentHashMap
to store
data.- See Also:
-
Repository
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConcurrentHashMap<ID,
T> AConcurrentHashMap
to store the data. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
data
AConcurrentHashMap
to store the data.
-
-
Constructor Details
-
RepositoryStub
public RepositoryStub()
-
-
Method Details
-
getId
Extracts theId
orId
orEmbeddedId
annotated field value from the entity.- Parameters:
entity
- the entity to extract the id from- Returns:
- the value of the
Id
orEmbeddedId
annotated field.
-