public class TransactionProxyFactory<T> extends Object
getTransactionScopedEntityManager() to get the transaction
scoped entity manager to pass to services.
For example:
JpaBuilder builder = ...
TransactionProxyFactory factory = new TransactionProxyFactory(
builder, Service.class);
Service service = new JpaService(factory.getTransactionScopedEntityManager());
Service proxy = factory.getProxy(service);
proxy.executeMethod(...);
The 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.| 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 © 2025. All rights reserved.