@Factory public class EntityManagerFactoryBean extends Object
EntityManagerFactory
.Constructor and Description |
---|
EntityManagerFactoryBean(JpaConfiguration jpaConfiguration,
Environment environment,
BeanLocator beanLocator) |
public EntityManagerFactoryBean(JpaConfiguration jpaConfiguration, Environment environment, BeanLocator beanLocator)
jpaConfiguration
- The JPA configurationenvironment
- The environmentbeanLocator
- The bean locator@Inject public void setHibernateInterceptor(@Nullable Interceptor hibernateInterceptor)
Interceptor
to use.hibernateInterceptor
- The hibernate interceptor@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
@EachBean(value=org.hibernate.boot.registry.StandardServiceRegistry.class) @Requires(entities=javax.persistence.Entity.class) protected MetadataSources hibernateMetadataSources(@Parameter String dataSourceName, StandardServiceRegistry standardServiceRegistry)
MetadataSources
for the given StandardServiceRegistry
.dataSourceName
- The data source namestandardServiceRegistry
- The standard service registryMetadataSources
@EachBean(value=org.hibernate.boot.MetadataSources.class) @Requires(beans=org.hibernate.boot.MetadataSources.class) protected SessionFactoryBuilder hibernateSessionFactoryBuilder(MetadataSources metadataSources, @Nullable ValidatorFactory validatorFactory)
SessionFactoryBuilder
to use.metadataSources
- The MetadataSources
validatorFactory
- The ValidatorFactory
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
@EachBean(value=org.hibernate.SessionFactory.class) @CurrentSession protected Session currentSession(@Parameter String dataSource, SessionFactory sessionFactory)
sessionFactory
- The session factorydataSource
- The name of the data source.protected MetadataSources createMetadataSources(@Nonnull StandardServiceRegistry serviceRegistry)
MetadataSources
for the given registry.serviceRegistry
- The registry