@Factory
public class EntityManagerFactoryBean
extends java.lang.Object
EntityManagerFactory.| Constructor and Description |
|---|
EntityManagerFactoryBean(JpaConfiguration jpaConfiguration,
io.micronaut.context.env.Environment environment,
io.micronaut.context.BeanLocator beanLocator) |
| Modifier and Type | Method and Description |
|---|---|
protected org.hibernate.boot.MetadataSources |
createMetadataSources(org.hibernate.boot.registry.StandardServiceRegistry serviceRegistry)
Creates the
MetadataSources for the given registry. |
protected org.hibernate.boot.MetadataSources |
hibernateMetadataSources(JpaConfiguration jpaConfiguration,
org.hibernate.boot.registry.StandardServiceRegistry standardServiceRegistry)
Builds the
MetadataSources for the given StandardServiceRegistry. |
protected org.hibernate.SessionFactory |
hibernateSessionFactory(org.hibernate.boot.SessionFactoryBuilder sessionFactoryBuilder)
Builds the actual
SessionFactory from the builder. |
protected org.hibernate.boot.SessionFactoryBuilder |
hibernateSessionFactoryBuilder(org.hibernate.boot.MetadataSources metadataSources,
javax.validation.ValidatorFactory validatorFactory)
Builds the
SessionFactoryBuilder to use. |
protected org.hibernate.boot.registry.StandardServiceRegistry |
hibernateStandardServiceRegistry(java.lang.String dataSourceName,
javax.sql.DataSource dataSource)
Builds the
StandardServiceRegistry bean for the given DataSource. |
void |
setHibernateInterceptor(org.hibernate.Interceptor hibernateInterceptor)
Sets the
Interceptor to use. |
public EntityManagerFactoryBean(JpaConfiguration jpaConfiguration, io.micronaut.context.env.Environment environment, io.micronaut.context.BeanLocator beanLocator)
jpaConfiguration - The JPA configurationenvironment - The environmentbeanLocator - The bean locator@Inject
public void setHibernateInterceptor(@Nullable
org.hibernate.Interceptor hibernateInterceptor)
Interceptor to use.hibernateInterceptor - The hibernate interceptor@EachBean(value=javax.sql.DataSource.class)
protected org.hibernate.boot.registry.StandardServiceRegistry hibernateStandardServiceRegistry(@Parameter
java.lang.String dataSourceName,
javax.sql.DataSource dataSource)
StandardServiceRegistry bean for the given DataSource.dataSourceName - The data source namedataSource - The data sourceStandardServiceRegistry@EachBean(value=org.hibernate.boot.registry.StandardServiceRegistry.class) @RequiresHibernateEntities protected org.hibernate.boot.MetadataSources hibernateMetadataSources(@Parameter JpaConfiguration jpaConfiguration, org.hibernate.boot.registry.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 org.hibernate.boot.SessionFactoryBuilder hibernateSessionFactoryBuilder(org.hibernate.boot.MetadataSources metadataSources,
@Nullable
javax.validation.ValidatorFactory validatorFactory)
SessionFactoryBuilder to use.metadataSources - The MetadataSourcesvalidatorFactory - The ValidatorFactorySessionFactoryBuilder@Context @Requires(beans=org.hibernate.boot.SessionFactoryBuilder.class) @Bean(preDestroy="close") @EachBean(value=org.hibernate.boot.SessionFactoryBuilder.class) protected org.hibernate.SessionFactory hibernateSessionFactory(org.hibernate.boot.SessionFactoryBuilder sessionFactoryBuilder)
SessionFactory from the builder.sessionFactoryBuilder - The SessionFactoryBuilderSessionFactoryprotected org.hibernate.boot.MetadataSources createMetadataSources(@Nonnull
org.hibernate.boot.registry.StandardServiceRegistry serviceRegistry)
MetadataSources for the given registry.serviceRegistry - The registry