Class ContainerManagedEntityManagerProvider
java.lang.Object
org.axonframework.extension.springboot.util.jpa.ContainerManagedEntityManagerProvider
- All Implemented Interfaces:
EntityManagerProvider
EntityManagerProvider implementation that expects the container to inject the default container managed
EntityManager
instance. This implementation expects the container to have exactly one PersistenceUnit, or provide a default if no
explicit Persistence Unit Name is provided.
- Since:
- 1.3
- Author:
- Allard Buijze
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.persistence.EntityManagerReturns the EntityManager instance to use.voidsetEntityManager(jakarta.persistence.EntityManager entityManager) Sets the container managed entityManager to use.
-
Constructor Details
-
ContainerManagedEntityManagerProvider
public ContainerManagedEntityManagerProvider()
-
-
Method Details
-
getEntityManager
@Nonnull public jakarta.persistence.EntityManager getEntityManager()Description copied from interface:EntityManagerProviderReturns the EntityManager instance to use. Note that the implementation is responsible for keeping track of transaction scope, if necessary. Generally, this is the case when using application-managed EntityManagers.- Specified by:
getEntityManagerin interfaceEntityManagerProvider- Returns:
- the EntityManager instance to use.
-
setEntityManager
public void setEntityManager(jakarta.persistence.EntityManager entityManager) Sets the container managed entityManager to use. Is generally injected by the application container.- Parameters:
entityManager- the entityManager to return upon request.
-