Search in sources :

Example 6 with LocalSessionFactoryBean

use of org.springframework.orm.hibernate5.LocalSessionFactoryBean in project tutorials by eugenp.

the class Cause1PersistenceConfig method sessionFactory.

@Bean
public LocalSessionFactoryBean sessionFactory() {
    final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
    sessionFactory.setDataSource(restDataSource());
    sessionFactory.setPackagesToScan(new String[] { "org.baeldung.ex.mappingexception.cause1.persistence.model" });
    sessionFactory.setHibernateProperties(hibernateProperties());
    return sessionFactory;
}
Also used : LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean) Bean(org.springframework.context.annotation.Bean) LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean)

Example 7 with LocalSessionFactoryBean

use of org.springframework.orm.hibernate5.LocalSessionFactoryBean in project tutorials by eugenp.

the class Cause2PersistenceConfig method sessionFactory.

@Bean
public LocalSessionFactoryBean sessionFactory() {
    final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
    sessionFactory.setDataSource(restDataSource());
    sessionFactory.setHibernateProperties(hibernateProperties());
    return sessionFactory;
}
Also used : LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean) Bean(org.springframework.context.annotation.Bean) LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean)

Example 8 with LocalSessionFactoryBean

use of org.springframework.orm.hibernate5.LocalSessionFactoryBean in project tutorials by eugenp.

the class Cause1NonTransientConfig method sessionFactory.

@Bean
public LocalSessionFactoryBean sessionFactory() {
    final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
    sessionFactory.setDataSource(restDataSource());
    sessionFactory.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
    sessionFactory.setHibernateProperties(hibernateProperties());
    return sessionFactory;
}
Also used : LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean) Bean(org.springframework.context.annotation.Bean) LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean)

Example 9 with LocalSessionFactoryBean

use of org.springframework.orm.hibernate5.LocalSessionFactoryBean in project tutorials by eugenp.

the class Cause4NonTransientConfig method sessionFactory.

@Bean
public LocalSessionFactoryBean sessionFactory() {
    final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
    sessionFactory.setDataSource(restDataSource());
    sessionFactory.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
    sessionFactory.setHibernateProperties(hibernateProperties());
    return sessionFactory;
}
Also used : LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean) Bean(org.springframework.context.annotation.Bean) LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean)

Example 10 with LocalSessionFactoryBean

use of org.springframework.orm.hibernate5.LocalSessionFactoryBean in project tutorials by eugenp.

the class PersistenceConfig method sessionFactory.

@Bean
public LocalSessionFactoryBean sessionFactory() {
    final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
    sessionFactory.setDataSource(restDataSource());
    sessionFactory.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
    sessionFactory.setHibernateProperties(hibernateProperties());
    return sessionFactory;
}
Also used : LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean) Bean(org.springframework.context.annotation.Bean) LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean)

Aggregations

Bean (org.springframework.context.annotation.Bean)17 LocalSessionFactoryBean (org.springframework.orm.hibernate4.LocalSessionFactoryBean)12 LocalSessionFactoryBean (org.springframework.orm.hibernate5.LocalSessionFactoryBean)7 Properties (java.util.Properties)6 IOException (java.io.IOException)2 Resource (org.springframework.core.io.Resource)2 LocalSessionFactoryBean (org.springframework.orm.hibernate3.LocalSessionFactoryBean)2 DruidDataSource (com.alibaba.druid.pool.DruidDataSource)1 SqlRepositoryBeanConfig (com.evolveum.midpoint.repo.sql.SqlRepositoryBeanConfig)1 DataSourcePropertiesBean (com.remswork.project.alice.bean.DataSourcePropertiesBean)1 SqlSessionFactoryBean (org.mybatis.spring.SqlSessionFactoryBean)1 FactoryBean (org.springframework.beans.factory.FactoryBean)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 DependsOn (org.springframework.context.annotation.DependsOn)1 ClassPathResource (org.springframework.core.io.ClassPathResource)1 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)1 SchedulerFactoryBean (org.springframework.scheduling.quartz.SchedulerFactoryBean)1