Project Wonder 5.0

er.memoryadaptor
Class ERMemoryAdaptorContext

java.lang.Object
  extended by com.webobjects.eoaccess.EOAdaptorContext
      extended by er.memoryadaptor.ERMemoryAdaptorContext

public class ERMemoryAdaptorContext
extends com.webobjects.eoaccess.EOAdaptorContext

ERMemoryAdaptorContext provides the adaptor context implementation for ERMemoryAdaptor. For the most part, you don't need to interact with ERMemoryAdaptor at this level. However, the context does expose resetEntity(EOEntity) and resetAllEntities() methods which allow control over resetting the memory datastore. This can be helpful when you need to reset the "database" between test cases.

Author:
mschrag

Nested Class Summary
 
Nested classes/interfaces inherited from class com.webobjects.eoaccess.EOAdaptorContext
com.webobjects.eoaccess.EOAdaptorContext.Delegate
 
Field Summary
 
Fields inherited from class com.webobjects.eoaccess.EOAdaptorContext
_adaptor, _channels, _delegate, _delegateRespondsTo_didBegin, _delegateRespondsTo_didCommit, _delegateRespondsTo_didRollback, _delegateRespondsTo_shouldBegin, _delegateRespondsTo_shouldCommit, _delegateRespondsTo_shouldConnect, _delegateRespondsTo_shouldRollback, _hasOpenTransaction, AdaptorContextBeginTransactionNotification, AdaptorContextCommitTransactionNotification, AdaptorContextRollbackTransactionNotification
 
Constructor Summary
ERMemoryAdaptorContext(com.webobjects.eoaccess.EOAdaptor adaptor)
           
 
Method Summary
 EREntityStore _entityStoreForEntity(com.webobjects.eoaccess.EOEntity entity)
          Returns an EREntityStore for the given entity.
 EREntityStore _entityStoreForEntity(com.webobjects.eoaccess.EOEntity entity, boolean transactional)
          Returns an EREntityStore for the given entity.
 com.webobjects.foundation.NSDictionary _newPrimaryKey(com.webobjects.eocontrol.EOEnterpriseObject object, com.webobjects.eoaccess.EOEntity entity)
           
 void beginTransaction()
           
 void commitTransaction()
           
 com.webobjects.eoaccess.EOAdaptorChannel createAdaptorChannel()
           
 void handleDroppedConnection()
           
 void resetAllEntities()
          Resets all the entities in this context, removing any known rows and clearing out any transactions.
 void resetEntity(com.webobjects.eoaccess.EOEntity entity)
          Resets the given entity, removing any known rows and clearing out any transactions.
 void rollbackTransaction()
           
 
Methods inherited from class com.webobjects.eoaccess.EOAdaptorContext
_registerAdaptorChannel, _unregisterAdaptorChannel, adaptor, canNestTransactions, channels, defaultDelegate, delegate, hasBusyChannels, hasOpenChannels, hasOpenTransaction, setDefaultDelegate, setDelegate, transactionDidBegin, transactionDidCommit, transactionDidRollback, transactionNestingLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERMemoryAdaptorContext

public ERMemoryAdaptorContext(com.webobjects.eoaccess.EOAdaptor adaptor)
Method Detail

resetAllEntities

public void resetAllEntities()
Resets all the entities in this context, removing any known rows and clearing out any transactions.


resetEntity

public void resetEntity(com.webobjects.eoaccess.EOEntity entity)
Resets the given entity, removing any known rows and clearing out any transactions.

Parameters:
entity - the entity to reset

_entityStoreForEntity

public EREntityStore _entityStoreForEntity(com.webobjects.eoaccess.EOEntity entity)
Returns an EREntityStore for the given entity.

Parameters:
entity - the entity to lookup
Returns:
the datastore for the entity

_entityStoreForEntity

public EREntityStore _entityStoreForEntity(com.webobjects.eoaccess.EOEntity entity,
                                           boolean transactional)
Returns an EREntityStore for the given entity.

Parameters:
entity - the entity to lookup
transactional - if true, this will return a transactional view of the store
Returns:
the datastore for the entity

_newPrimaryKey

public com.webobjects.foundation.NSDictionary _newPrimaryKey(com.webobjects.eocontrol.EOEnterpriseObject object,
                                                             com.webobjects.eoaccess.EOEntity entity)
Overrides:
_newPrimaryKey in class com.webobjects.eoaccess.EOAdaptorContext

beginTransaction

public void beginTransaction()
Specified by:
beginTransaction in class com.webobjects.eoaccess.EOAdaptorContext

commitTransaction

public void commitTransaction()
Specified by:
commitTransaction in class com.webobjects.eoaccess.EOAdaptorContext

createAdaptorChannel

public com.webobjects.eoaccess.EOAdaptorChannel createAdaptorChannel()
Specified by:
createAdaptorChannel in class com.webobjects.eoaccess.EOAdaptorContext

handleDroppedConnection

public void handleDroppedConnection()
Specified by:
handleDroppedConnection in class com.webobjects.eoaccess.EOAdaptorContext

rollbackTransaction

public void rollbackTransaction()
Specified by:
rollbackTransaction in class com.webobjects.eoaccess.EOAdaptorContext

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.