Class JpaTransactionalExecutorProvider
java.lang.Object
org.axonframework.eventsourcing.eventstore.jpa.JpaTransactionalExecutorProvider
- All Implemented Interfaces:
TransactionalExecutorProvider<jakarta.persistence.EntityManager>
@Internal
public class JpaTransactionalExecutorProvider
extends Object
implements TransactionalExecutorProvider<jakarta.persistence.EntityManager>
A
TransactionalExecutorProvider implementation for JPA EntityManagers which
provides a TransactionalExecutor.
When a processing context is supplied, supplies the TransactionalExecutor it must contain.
If no processing context is supplied, creates an executor that executes the supplied functions
in their own transaction.
- Since:
- 5.0.2
- Author:
- John Hendrikx
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Context.ResourceKey<Supplier<EntityManagerExecutor>> The resource key for theEntityManagerExecutorsupplier. -
Constructor Summary
ConstructorsConstructorDescriptionJpaTransactionalExecutorProvider(jakarta.persistence.EntityManagerFactory entityManagerFactory) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionTransactionalExecutor<jakarta.persistence.EntityManager> getTransactionalExecutor(ProcessingContext processingContext) Provides aTransactionalExecutor, using the optional processing context.
-
Field Details
-
SUPPLIER_KEY
The resource key for theEntityManagerExecutorsupplier.
-
-
Constructor Details
-
JpaTransactionalExecutorProvider
public JpaTransactionalExecutorProvider(@Nonnull jakarta.persistence.EntityManagerFactory entityManagerFactory) Constructs a new instance.- Parameters:
entityManagerFactory- A factory constructing anEntityManagerused when no processing context is supplied.
-
-
Method Details
-
getTransactionalExecutor
public TransactionalExecutor<jakarta.persistence.EntityManager> getTransactionalExecutor(@Nullable ProcessingContext processingContext) Description copied from interface:TransactionalExecutorProviderProvides aTransactionalExecutor, using the optional processing context.- Specified by:
getTransactionalExecutorin interfaceTransactionalExecutorProvider<jakarta.persistence.EntityManager>- Parameters:
processingContext- AProcessingContext, can benull.- Returns:
- A
TransactionalExecutor, nevernull.
-