com.subshell.persistence.mapper
Class TransactionPersistenceMapperFactory

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

public class TransactionPersistenceMapperFactory
extends Object
implements PersistenceMapperFactory

Persistence mapper factory implementation which provides persistence mappers with Transactions.

The PersistenceMapperConfiguration specified in the constructor call to this class must contain subclasses of TransactionPersistenceMapper.


Constructor Summary
TransactionPersistenceMapperFactory(PersistenceMapperConfiguration configuration, TransactionFactory transactionFactory)
          Creates a new transaction persistence mapper factory.
 
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

TransactionPersistenceMapperFactory

public TransactionPersistenceMapperFactory(PersistenceMapperConfiguration configuration,
                                           TransactionFactory transactionFactory)
Creates a new transaction persistence mapper factory.

Parameters:
configuration - persistence mapper configuration. This configuration must contain subclasses of TransactionPersistenceMapper only.
transactionFactory - factory providing transactions
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


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