com.subshell.persistence.mapper
Class TransactionContextPersistenceMapperFactory

java.lang.Object
  extended by com.subshell.persistence.mapper.TransactionPersistenceMapperFactory
      extended by com.subshell.persistence.mapper.TransactionContextPersistenceMapperFactory
All Implemented Interfaces:
PersistenceMapperFactory

public class TransactionContextPersistenceMapperFactory
extends TransactionPersistenceMapperFactory

PersistenceMapperFactory implementation that is aware of an outer TransactionContext. It uses the TransactionContext to cache instances of PersistenceMapper to avoid excessive creation of those during a transaction.


Constructor Summary
TransactionContextPersistenceMapperFactory(PersistenceMapperConfiguration configuration)
           
 
Method Summary
<T> PersistenceMapper<T>
getMapper(Class<T> clazz)
          Returns the persistence mapper for objects of class clazz.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionContextPersistenceMapperFactory

public TransactionContextPersistenceMapperFactory(PersistenceMapperConfiguration configuration)
Method Detail

getMapper

public <T> PersistenceMapper<T> getMapper(Class<T> clazz)
Description copied from interface: PersistenceMapperFactory

Returns the persistence mapper for objects of class clazz.

Note: It is highly recommended that clients cache the returned persistence mapper for as long as the transaction is active.

The persistence mapper must not be used across transaction boundaries. That is, a persistence mapper must not be used during a different transaction than the one during which it was created.

Specified by:
getMapper in interface PersistenceMapperFactory
Overrides:
getMapper in class TransactionPersistenceMapperFactory


Copyright © 2004-2005 subshell GmbH. All Rights Reserved.