@Factory public class EntityManagerFactoryBean extends Object
EntityManagerFactory
.Constructor and Description |
---|
EntityManagerFactoryBean(JpaConfiguration jpaConfiguration,
Integrator integrator,
io.micronaut.context.ApplicationContext applicationContext) |
Modifier and Type | Method and Description |
---|---|
protected MetadataSources |
createMetadataSources(StandardServiceRegistry serviceRegistry)
Creates the
MetadataSources for the given registry. |
protected MetadataSources |
hibernateMetadataSources(JpaConfiguration jpaConfiguration,
StandardServiceRegistry standardServiceRegistry)
Builds the
MetadataSources for the given StandardServiceRegistry . |
protected SessionFactory |
hibernateSessionFactory(SessionFactoryBuilder sessionFactoryBuilder)
Builds the actual
SessionFactory from the builder. |
protected SessionFactoryBuilder |
hibernateSessionFactoryBuilder(MetadataSources metadataSources,
javax.validation.ValidatorFactory validatorFactory,
Interceptor hibernateInterceptor)
Builds the
SessionFactoryBuilder to use. |
protected StandardServiceRegistry |
hibernateStandardServiceRegistry(String dataSourceName,
DataSource dataSource)
Builds the
StandardServiceRegistry bean for the given DataSource . |
public EntityManagerFactoryBean(@Primary @Nullable JpaConfiguration jpaConfiguration, @Primary @Nullable Integrator integrator, io.micronaut.context.ApplicationContext applicationContext)
jpaConfiguration
- The JPA configurationintegrator
- The integrationapplicationContext
- The application context@EachBean(value=javax.sql.DataSource.class) protected StandardServiceRegistry hibernateStandardServiceRegistry(@Parameter String dataSourceName, DataSource dataSource)
StandardServiceRegistry
bean for the given DataSource
.dataSourceName
- The data source namedataSource
- The data sourceStandardServiceRegistry
@Requires(classes=org.hibernate.mapping.MetadataSource.class) @EachBean(value=org.hibernate.boot.registry.StandardServiceRegistry.class) protected MetadataSources hibernateMetadataSources(@Parameter @Nullable JpaConfiguration jpaConfiguration, StandardServiceRegistry standardServiceRegistry)
MetadataSources
for the given StandardServiceRegistry
.jpaConfiguration
- The JPA configurationstandardServiceRegistry
- The standard service registryMetadataSources
@EachBean(value=org.hibernate.boot.MetadataSources.class) @Requires(beans=org.hibernate.boot.MetadataSources.class) protected SessionFactoryBuilder hibernateSessionFactoryBuilder(MetadataSources metadataSources, @Nullable javax.validation.ValidatorFactory validatorFactory, @Nullable Interceptor hibernateInterceptor)
SessionFactoryBuilder
to use.metadataSources
- The MetadataSources
validatorFactory
- The ValidatorFactory
hibernateInterceptor
- The Interceptor
SessionFactoryBuilder
@Context @Requires(beans=org.hibernate.boot.SessionFactoryBuilder.class) @Bean(preDestroy="close") @EachBean(value=org.hibernate.boot.SessionFactoryBuilder.class) protected SessionFactory hibernateSessionFactory(SessionFactoryBuilder sessionFactoryBuilder)
SessionFactory
from the builder.sessionFactoryBuilder
- The SessionFactoryBuilder
SessionFactory
protected MetadataSources createMetadataSources(@NonNull StandardServiceRegistry serviceRegistry)
MetadataSources
for the given registry.serviceRegistry
- The registry