Package io.jmix.core
Interface DataStore
- All Known Implementing Classes:
AbstractDataStore
,JpaDataStore
,NoopDataStore
,RestDataStore
,TestInMemoryDataStore
public interface DataStore
Interface defining methods for CRUD operations on entities.
Implementations of this interface must be prototype beans. They are used by DataManager
, do not access
data stores directly from your application code.
-
Method Summary
Modifier and TypeMethodDescriptionlong
getCount
(LoadContext<?> context) Returns the number of entity instances for the given query passed in theLoadContext
.long
getCount
(ValueLoadContext context) Returns the number of key-value pairs for the given query passed in theValueLoadContext
.getName()
This data store instance name with which it is registered inStores
.load
(LoadContext<?> context) Loads a single entity instance.loadList
(LoadContext<?> context) Loads collection of entity instances.loadValues
(ValueLoadContext context) Loads list of key-value pairs.Set<?>
save
(SaveContext context) Saves a collection of entity instances.void
Sets this data store instance name with which it is registered inStores
.
-
Method Details
-
getName
String getName()This data store instance name with which it is registered inStores
. -
setName
Sets this data store instance name with which it is registered inStores
. -
load
Loads a single entity instance.- Returns:
- the loaded object, or null if not found
-
loadList
Loads collection of entity instances.- Returns:
- a list of instances, or empty list if nothing found
-
getCount
Returns the number of entity instances for the given query passed in theLoadContext
.- Returns:
- number of instances in the storage
-
save
Saves a collection of entity instances.- Returns:
- set of saved instances
-
loadValues
Loads list of key-value pairs.- Parameters:
context
- defines a query for scalar values and a list of keys for returned KeyValueEntity- Returns:
- list of KeyValueEntity instances
-
getCount
Returns the number of key-value pairs for the given query passed in theValueLoadContext
.- Parameters:
context
- defines the query- Returns:
- number of key-value pairs in the data store
-