Class JpaAutoConfiguration
java.lang.Object
org.axonframework.extension.springboot.autoconfig.JpaAutoConfiguration
@AutoConfiguration(afterName="org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration")
@ConditionalOnClass(jakarta.persistence.EntityManagerFactory.class)
@ConditionalOnBean(jakarta.persistence.EntityManagerFactory.class)
@EnableConfigurationProperties(TokenStoreProperties.class)
public class JpaAutoConfiguration
extends Object
Autoconfiguration class for Axon's JPA specific infrastructure components.
- Since:
- 3.0.3
- Author:
- Allard Buijze, Simon Zambrovski
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves an entity manager provider.persistenceExceptionResolver(DataSource dataSource) Provides a persistence exception resolver for a data source.tokenStore(EntityManagerProvider entityManagerProvider, TokenStoreProperties tokenStoreProperties, com.fasterxml.jackson.databind.ObjectMapper defaultAxonObjectMapper) Builds a JPA Token Store.
-
Constructor Details
-
JpaAutoConfiguration
public JpaAutoConfiguration()
-
-
Method Details
-
entityManagerProvider
Retrieves an entity manager provider.- Returns:
- An entity manager provider.
-
tokenStore
@Bean @ConditionalOnMissingBean public TokenStore tokenStore(EntityManagerProvider entityManagerProvider, TokenStoreProperties tokenStoreProperties, com.fasterxml.jackson.databind.ObjectMapper defaultAxonObjectMapper) Builds a JPA Token Store.- Parameters:
entityManagerProvider- An entity manager provider to retrieve connections.tokenStoreProperties- A set of properties to configure the token store.defaultAxonObjectMapper- An object mapper to use for token conversion to JSON.- Returns:
- Instance of JPA token store.
-
persistenceExceptionResolver
@Bean @ConditionalOnMissingBean public PersistenceExceptionResolver persistenceExceptionResolver(DataSource dataSource) throws SQLException Provides a persistence exception resolver for a data source.- Parameters:
dataSource- A data source configured to resolve exception for.- Returns:
- A working copy of Persistence Exception Resolver.
- Throws:
SQLException- on any construction errors.
-