org.springframework.datastore.mock
Class SimpleMapDatastore

java.lang.Object
  extended by org.springframework.datastore.core.AbstractDatastore
      extended by org.springframework.datastore.mock.SimpleMapDatastore
All Implemented Interfaces:
Datastore, EntityInterceptorAware

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

Since:
1.0

Field Summary
 
Fields inherited from class org.springframework.datastore.core.AbstractDatastore
connectionDetails, interceptors, mappingContext
 
Constructor Summary
SimpleMapDatastore()
           
SimpleMapDatastore(Map<String,Map> datastore)
          Creates a map based datastore backing onto the specified map
 
Method Summary
 void clearData()
           
protected  Session createSession(Map<String,String> connectionDetails)
          Creates the native session
 Map<String,Map> getBackingMap()
           
 Map getIndices()
           
 
Methods inherited from class org.springframework.datastore.core.AbstractDatastore
addEntityInterceptor, bindSession, clearCurrentConnection, connect, connect, getCurrentSession, getMappingContext, retrieveSession, setConnectionDetails, setEntityInterceptors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleMapDatastore

public SimpleMapDatastore(Map<String,Map> datastore)
Creates a map based datastore backing onto the specified map

Parameters:
datastore - The datastore to back on to

SimpleMapDatastore

public SimpleMapDatastore()
Method Detail

getIndices

public Map getIndices()

createSession

protected Session createSession(Map<String,String> connectionDetails)
Description copied from class: AbstractDatastore
Creates the native session

Specified by:
createSession in class AbstractDatastore
Parameters:
connectionDetails - The session details
Returns:
The session object

getBackingMap

public Map<String,Map> getBackingMap()

clearData

public void clearData()