org.grails.datastore.mapping.simple
Class SimpleMapDatastore
java.lang.Object
org.grails.datastore.mapping.core.AbstractDatastore
org.grails.datastore.mapping.simple.SimpleMapDatastore
- All Implemented Interfaces:
- org.grails.datastore.mapping.core.Datastore, org.springframework.beans.factory.DisposableBean
public class SimpleMapDatastore
- extends org.grails.datastore.mapping.core.AbstractDatastore
A simple implementation of the Datastore interface that backs onto an in-memory map.
Mainly used for mocking and testing scenarios.
- Since:
- 1.0
| Fields inherited from class org.grails.datastore.mapping.core.AbstractDatastore |
cacheAdapterRepository, connectionDetails, mappingContext |
|
Constructor Summary |
SimpleMapDatastore()
|
SimpleMapDatastore(org.springframework.context.ConfigurableApplicationContext ctx)
|
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.grails.datastore.mapping.model.MappingContext mappingContext,
org.springframework.context.ConfigurableApplicationContext ctx)
Creates a map based datastore for the specified mapping context |
|
Method Summary |
void |
clearData()
|
protected org.grails.datastore.mapping.core.Session |
createSession(java.util.Map<java.lang.String,java.lang.String> connectionDetails)
|
java.util.Map<java.lang.String,java.util.Map> |
getBackingMap()
|
java.util.Map |
getIndices()
|
| Methods inherited from class org.grails.datastore.mapping.core.AbstractDatastore |
connect, connect, destroy, getApplicationContext, getApplicationEventPublisher, getCurrentSession, getMappingContext, getObjectErrors, getValidationErrorsMap, getValidationSkipMap, hasCurrentSession, initializeConverters, isIndexed, isSchemaless, registerValidationListener, retrieveSession, retrieveSession, setApplicationContext, setConnectionDetails, setObjectErrors, setSkipValidation, skipValidation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleMapDatastore
public 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
- Parameters:
datastore - The datastore to back on toctx - the application context
SimpleMapDatastore
public SimpleMapDatastore(org.grails.datastore.mapping.model.MappingContext mappingContext,
org.springframework.context.ConfigurableApplicationContext ctx)
- Creates a map based datastore for the specified mapping context
- Parameters:
mappingContext - The mapping context
SimpleMapDatastore
public SimpleMapDatastore()
SimpleMapDatastore
public SimpleMapDatastore(org.springframework.context.ConfigurableApplicationContext ctx)
getIndices
public java.util.Map getIndices()
createSession
protected org.grails.datastore.mapping.core.Session createSession(java.util.Map<java.lang.String,java.lang.String> connectionDetails)
- Specified by:
createSession in class org.grails.datastore.mapping.core.AbstractDatastore
getBackingMap
public java.util.Map<java.lang.String,java.util.Map> getBackingMap()
clearData
public void clearData()