public class TransactionProxyFactory<T> extends Object
getTransactionScopedEntityManager()
to get the transaction
scoped entity manager to pass to services.
For example:
JpaBuilder builder = ... TransactionProxyFactoryThe above example executes the executeMethod() call on the service object within an active transaction. In the constructor of the service a transaction scoped entity manager is passed.factory = new TransactionProxyFactory ( builder, Service.class); Service service = new JpaService(factory.getTransactionScopedEntityManager()); Service proxy = factory.getProxy(service); proxy.executeMethod(...);
Constructor and Description |
---|
TransactionProxyFactory(JpaBuilder aJpaBuilder,
Class<T> aClass)
Constructs the transaction proxy.
|
Modifier and Type | Method and Description |
---|---|
T |
getProxy(T aService) |
javax.persistence.EntityManager |
getTransactionScopedEntityManager() |
public TransactionProxyFactory(JpaBuilder aJpaBuilder, Class<T> aClass)
aJpaBuilder
- Copyright © 2022. All rights reserved.