org.springframework.datastore.mock
Class SimpleMapSession

java.lang.Object
  extended by org.springframework.datastore.core.AbstractSession<Map>
      extended by org.springframework.datastore.mock.SimpleMapSession
All Implemented Interfaces:
Session, SessionImplementor, EntityInterceptorAware

public class SimpleMapSession
extends AbstractSession<Map>

A simple implementation of the Session 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.AbstractSession
attributes, firstLevelCache, interceptors, lockedObjects, objectToKey, pendingDeletes, pendingInserts, pendingUpdates, persisters
 
Constructor Summary
SimpleMapSession(SimpleMapDatastore datastore, MappingContext mappingContext)
           
 
Method Summary
protected  Transaction beginTransactionInternal()
           
protected  Persister createPersister(Class cls, MappingContext mappingContext)
           
 void disconnect()
          Performs clear up.
 Map<String,Map> getBackingMap()
           
 Map getNativeInterface()
           
 boolean isConnected()
           
 
Methods inherited from class org.springframework.datastore.core.AbstractSession
addEntityInterceptor, attach, beginTransaction, cacheObject, clear, clear, contains, createQuery, delete, delete, flush, getAttribute, getDatastore, getFlushMode, getMappingContext, getPendingDeletes, getPendingInserts, getPendingUpdates, getPersister, getTransaction, lock, lock, persist, persist, postFlush, proxy, refresh, retrieve, retrieveAll, retrieveAll, setAttribute, setEntityInterceptors, setFlushMode, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleMapSession

public SimpleMapSession(SimpleMapDatastore datastore,
                        MappingContext mappingContext)
Method Detail

createPersister

protected Persister createPersister(Class cls,
                                    MappingContext mappingContext)
Specified by:
createPersister in class AbstractSession<Map>

getBackingMap

public Map<String,Map> getBackingMap()

beginTransactionInternal

protected Transaction beginTransactionInternal()
Specified by:
beginTransactionInternal in class AbstractSession<Map>

isConnected

public boolean isConnected()
Returns:
true if connected to the datastore

disconnect

public void disconnect()
Description copied from class: AbstractSession
Performs clear up. Subclasses should always call into this super implementation.

Specified by:
disconnect in interface Session
Overrides:
disconnect in class AbstractSession<Map>

getNativeInterface

public Map getNativeInterface()
Returns:
The native interface to the datastore