@java.lang.SuppressWarnings("rawtypes") public class SimpleMapDatastore extends AbstractDatastore implements java.io.Closeable, ConnectionSourcesProvider, MultipleConnectionSourceCapableDatastore, SchemaMultiTenantCapableDatastore, TransactionCapableDatastore
A simple implementation of the Datastore interface that backs onto an in-memory map. Mainly used for mocking and testing scenarios.
Modifiers | Name | Description |
---|---|---|
private ConnectionSources<java.util.Map<java.lang.String, java.util.Map>, ConnectionSourceSettings> |
connectionSources |
|
protected java.util.Map<java.lang.String, SimpleMapDatastore> |
datastoresByConnectionSource |
|
private ConfigurableApplicationEventPublisher |
eventPublisher |
|
protected boolean |
failOnError |
|
protected GormEnhancer |
gormEnhancer |
|
private java.util.Map |
indices |
|
private java.util.Map<java.lang.String, java.util.Map> |
inmemoryData |
|
private MultiTenancyMode |
multiTenancyMode |
|
private TenantResolver |
tenantResolver |
|
private org.springframework.transaction.PlatformTransactionManager |
transactionManager |
Fields inherited from class | Fields |
---|---|
class AbstractDatastore |
LOG, applicationContext, cacheAdapterRepository, connectionDetails, mappingContext, serviceRegistry |
Constructor and description |
---|
SimpleMapDatastore
(ConnectionSources<java.util.Map<java.lang.String, java.util.Map>, ConnectionSourceSettings> connectionSources, MappingContext mappingContext, ConfigurableApplicationEventPublisher eventPublisher) |
SimpleMapDatastore
(ConnectionSources<java.util.Map<java.lang.String, java.util.Map>, ConnectionSourceSettings> connectionSources, ConfigurableApplicationEventPublisher eventPublisher, java.lang.Class classes) |
SimpleMapDatastore
(org.springframework.core.env.PropertyResolver configuration, ConfigurableApplicationEventPublisher eventPublisher, java.lang.Class classes) |
SimpleMapDatastore
() |
SimpleMapDatastore
(java.lang.Iterable<java.lang.String> dataSourceNames, java.lang.Class classes) |
SimpleMapDatastore
(java.lang.Class classes) |
SimpleMapDatastore
(org.springframework.core.env.PropertyResolver configuration, java.lang.Iterable<java.lang.String> dataSourceNames, java.lang.Class classes) |
SimpleMapDatastore
(org.springframework.core.env.PropertyResolver configuration, java.lang.Iterable<java.lang.String> dataSourceNames, java.lang.Package packages) |
SimpleMapDatastore
(java.util.Map configuration, java.lang.Iterable<java.lang.String> dataSourceNames, java.lang.Package packages) |
SimpleMapDatastore
(java.util.Map configuration, java.lang.Package packages) |
SimpleMapDatastore
(org.springframework.core.env.PropertyResolver configuration, java.lang.Iterable<java.lang.String> dataSourceNames, java.lang.Package packageToScan) |
SimpleMapDatastore
(java.util.Map<java.lang.String, java.util.Map> datastore, org.springframework.context.ConfigurableApplicationContext ctx) Creates a map based datastore backing onto the specified map |
SimpleMapDatastore
(org.springframework.context.ConfigurableApplicationContext ctx) |
SimpleMapDatastore
(MappingContext mappingContext, org.springframework.context.ConfigurableApplicationContext ctx) Creates a map based datastore for the specified mapping context |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addTenantForSchema(java.lang.String schemaName) |
|
public void |
clearData() |
|
public void |
close() |
|
protected static KeyValueMappingContext |
createMappingContext(ConnectionSources<java.util.Map<java.lang.String, java.util.Map>, ConnectionSourceSettings> connectionSources, java.lang.Class classes) |
|
protected static InMemoryConnectionSources<java.util.Map<java.lang.String, java.util.Map>, ConnectionSourceSettings> |
createMultipleDataSources(java.lang.Iterable<java.lang.String> dataSourceNames, org.springframework.core.env.PropertyResolver propertyResolver) |
|
protected Session |
createSession(org.springframework.core.env.PropertyResolver connectionDetails) |
|
public org.springframework.context.ApplicationEventPublisher |
getApplicationEventPublisher() |
|
public java.util.Map<java.lang.String, java.util.Map> |
getBackingMap() |
|
private static org.springframework.core.env.PropertyResolver |
getConfiguration(org.springframework.context.ConfigurableApplicationContext ctx) |
|
protected java.lang.Iterable<java.lang.String> |
getConnectionSourceNames(ConnectionSourceFactory<java.util.Map<java.lang.String, java.util.Map>, ConnectionSourceSettings> connectionSourceFactory, org.springframework.core.env.PropertyResolver configuration) |
|
public ConnectionSources<java.util.Map<java.lang.String, java.util.Map>, ConnectionSourceSettings> |
getConnectionSources() |
|
public Datastore |
getDatastoreForConnection(java.lang.String connectionName) |
<D> |
private SimpleMapDatastore |
getDatastoreForQualifier(java.lang.Class<D> cls, java.lang.String qualifier) |
|
public Datastore |
getDatastoreForTenantId(java.io.Serializable tenantId) |
|
public java.util.Map |
getIndices() |
<D> |
protected GormInstanceApi<D> |
getInstanceApi(java.lang.Class<D> cls, java.lang.String qualifier) |
|
public MultiTenancyMode |
getMultiTenancyMode() |
<D> |
protected GormStaticApi<D> |
getStaticApi(java.lang.Class<D> cls, java.lang.String qualifier) |
|
public TenantResolver |
getTenantResolver() |
|
public org.springframework.transaction.PlatformTransactionManager |
getTransactionManager() |
<D> |
protected GormValidationApi<D> |
getValidationApi(java.lang.Class<D> cls, java.lang.String qualifier) |
|
protected GormEnhancer |
initialize(ConnectionSourceSettings settings) |
|
protected GormEnhancer |
initialize(ConnectionSourceSettings settings) |
|
protected GormEnhancer |
initialize(ConnectionSourceSettings settings) |
|
public void |
persistentEntityAdded(PersistentEntity entity) |
|
protected void |
registerEventListeners(ConfigurableApplicationEventPublisher eventPublisher) |
<T1> |
public T1 |
withNewSession(java.io.Serializable tenantId, groovy.lang.Closure<T1> callable) |
Methods inherited from class | Name |
---|---|
class AbstractDatastore |
connect, connect, connectStateless, createSession, createStatelessSession, destroy, doInSession, getApplicationContext, getApplicationEventPublisher, getCurrentSession, getMappingContext, getService, getServices, hasCurrentSession, initializeConverters, isIndexed, isSchemaless, mapToPropertyResolver, publishSessionCreationEvent, retrieveSession, retrieveSession, setApplicationContext, withSession |
Creates a map based datastore backing onto the specified map
datastore
- The datastore to back on toctx
- the application contextCreates a map based datastore for the specified mapping context
mappingContext
- The mapping context