org.grails.datastore.mapping.simple
Class SimpleMapSession

java.lang.Object
  extended by org.grails.datastore.mapping.core.AbstractAttributeStoringSession
      extended by org.grails.datastore.mapping.core.AbstractSession<java.util.Map>
          extended by org.grails.datastore.mapping.simple.SimpleMapSession
All Implemented Interfaces:
org.grails.datastore.mapping.core.Session, org.grails.datastore.mapping.core.SessionImplementor

public class SimpleMapSession
extends org.grails.datastore.mapping.core.AbstractSession<java.util.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.grails.datastore.mapping.core.AbstractSession
cacheAdapterRepository, firstLevelCache, firstLevelCollectionCache, firstLevelEntryCache, firstLevelEntryCacheDirtyCheck, lockedObjects, objectToKey, pendingDeletes, persisters, postFlushOperations, publisher
 
Fields inherited from class org.grails.datastore.mapping.core.AbstractAttributeStoringSession
attributes
 
Constructor Summary
SimpleMapSession(SimpleMapDatastore datastore, org.grails.datastore.mapping.model.MappingContext mappingContext, org.springframework.context.ApplicationEventPublisher publisher)
           
 
Method Summary
protected  org.grails.datastore.mapping.transactions.Transaction beginTransactionInternal()
           
protected  org.grails.datastore.mapping.engine.Persister createPersister(java.lang.Class cls, org.grails.datastore.mapping.model.MappingContext mappingContext)
           
 java.util.Map<java.lang.String,java.util.Map> getBackingMap()
           
 java.util.Map getNativeInterface()
           
 
Methods inherited from class org.grails.datastore.mapping.core.AbstractSession
addPendingInsert, addPendingUpdate, addPostFlushOperation, attach, beginTransaction, cacheCollection, cacheEntry, cacheEntry, cacheInstance, cacheObject, clear, clear, contains, createQuery, delete, delete, deleteAll, flush, flushPendingInserts, flushPendingUpdates, getCachedCollection, getCachedEntry, getCachedEntry, getCachedInstance, getDatastore, getFlushMode, getMappingContext, getPendingDeletes, getPendingInserts, getPendingUpdates, getPersister, getTransaction, isCached, isDirty, lock, lock, persist, persist, postFlush, proxy, refresh, retrieve, retrieveAll, retrieveAll, setFlushMode, unlock, updateAll
 
Methods inherited from class org.grails.datastore.mapping.core.AbstractAttributeStoringSession
disconnect, getAttribute, isConnected, setAttribute
 
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,
                        org.grails.datastore.mapping.model.MappingContext mappingContext,
                        org.springframework.context.ApplicationEventPublisher publisher)
Method Detail

createPersister

protected org.grails.datastore.mapping.engine.Persister createPersister(java.lang.Class cls,
                                                                        org.grails.datastore.mapping.model.MappingContext mappingContext)
Specified by:
createPersister in class org.grails.datastore.mapping.core.AbstractSession<java.util.Map>

getBackingMap

public java.util.Map<java.lang.String,java.util.Map> getBackingMap()

beginTransactionInternal

protected org.grails.datastore.mapping.transactions.Transaction beginTransactionInternal()
Specified by:
beginTransactionInternal in class org.grails.datastore.mapping.core.AbstractSession<java.util.Map>

getNativeInterface

public java.util.Map getNativeInterface()