@java.lang.SuppressWarnings("rawtypes") public class SimpleMapDatastore extends AbstractDatastore
A simple implementation of the Datastore interface that backs onto an in-memory map. Mainly used for mocking and testing scenarios.
Modifiers | Name | Description |
---|---|---|
protected java.util.Map<java.lang.String, SimpleMapDatastore> |
datastoresByConnectionSource |
|
protected boolean |
failOnError |
|
protected GormEnhancer |
gormEnhancer |
Fields inherited from class | Fields |
---|---|
class AbstractDatastore |
LOG, 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 |
---|---|---|
|
void |
addTenantForSchema(java.lang.String schemaName) |
|
void |
clearData() |
|
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) |
|
org.springframework.context.ApplicationEventPublisher |
getApplicationEventPublisher() |
|
java.util.Map<java.lang.String, java.util.Map> |
getBackingMap() |
|
ConnectionSources<java.util.Map<java.lang.String, java.util.Map>, ConnectionSourceSettings> |
getConnectionSources() |
|
Datastore |
getDatastoreForConnection(java.lang.String connectionName) |
|
Datastore |
getDatastoreForTenantId(java.io.Serializable tenantId) |
|
java.util.Map |
getIndices() |
|
MultiTenancyMode |
getMultiTenancyMode() |
|
TenantResolver |
getTenantResolver() |
|
org.springframework.transaction.PlatformTransactionManager |
getTransactionManager() |
|
protected GormEnhancer |
initialize(ConnectionSourceSettings settings) |
|
protected void |
registerEventListeners(ConfigurableApplicationEventPublisher eventPublisher) |
<T1> |
T1 |
withNewSession(java.io.Serializable tenantId, groovy.lang.Closure<T1> callable) |
Methods inherited from class | Name |
---|---|
class AbstractDatastore |
connect, connect, connectStateless, createSession, createStatelessSession, destroy, getApplicationContext, getApplicationEventPublisher, getCurrentSession, getMappingContext, getService, getServices, hasCurrentSession, initializeConverters, isIndexed, isSchemaless, mapToPropertyResolver, retrieveSession, retrieveSession, setApplicationContext, withSession |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
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