Search in sources :

Example 6 with HibernateTransactionManager

use of org.springframework.orm.hibernate4.HibernateTransactionManager in project tutorials by eugenp.

the class Cause2PersistenceConfig method transactionManager.

@Bean
public HibernateTransactionManager transactionManager() {
    final HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(sessionFactory().getObject());
    return txManager;
}
Also used : HibernateTransactionManager(org.springframework.orm.hibernate4.HibernateTransactionManager) Bean(org.springframework.context.annotation.Bean) LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean)

Example 7 with HibernateTransactionManager

use of org.springframework.orm.hibernate4.HibernateTransactionManager in project tutorials by eugenp.

the class Cause3PersistenceConfig method transactionManager.

@Bean
public HibernateTransactionManager transactionManager() {
    final HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(sessionFactory().getObject());
    return txManager;
}
Also used : HibernateTransactionManager(org.springframework.orm.hibernate4.HibernateTransactionManager) Bean(org.springframework.context.annotation.Bean) LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean)

Example 8 with HibernateTransactionManager

use of org.springframework.orm.hibernate4.HibernateTransactionManager in project tutorials by eugenp.

the class Cause1NonTransientConfig method transactionManager.

@Bean
public HibernateTransactionManager transactionManager() {
    final HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(sessionFactory().getObject());
    return txManager;
}
Also used : HibernateTransactionManager(org.springframework.orm.hibernate4.HibernateTransactionManager) Bean(org.springframework.context.annotation.Bean) LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean)

Example 9 with HibernateTransactionManager

use of org.springframework.orm.hibernate4.HibernateTransactionManager in project tutorials by eugenp.

the class Cause4NonTransientConfig method transactionManager.

@Bean
public HibernateTransactionManager transactionManager() {
    final HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(sessionFactory().getObject());
    return txManager;
}
Also used : HibernateTransactionManager(org.springframework.orm.hibernate4.HibernateTransactionManager) Bean(org.springframework.context.annotation.Bean) LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean)

Example 10 with HibernateTransactionManager

use of org.springframework.orm.hibernate4.HibernateTransactionManager in project tutorials by eugenp.

the class Cause5NonTransientConfig method transactionManager.

@Bean
public HibernateTransactionManager transactionManager() {
    final HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(sessionFactory().getObject());
    return txManager;
}
Also used : HibernateTransactionManager(org.springframework.orm.hibernate4.HibernateTransactionManager) Bean(org.springframework.context.annotation.Bean) LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean)

Aggregations

Bean (org.springframework.context.annotation.Bean)19 HibernateTransactionManager (org.springframework.orm.hibernate4.HibernateTransactionManager)11 LocalSessionFactoryBean (org.springframework.orm.hibernate4.LocalSessionFactoryBean)10 HibernateTransactionManager (org.springframework.orm.hibernate5.HibernateTransactionManager)6 LocalSessionFactoryBean (org.springframework.orm.hibernate5.LocalSessionFactoryBean)5 HibernateTransactionManager (org.springframework.orm.hibernate3.HibernateTransactionManager)4 Autowired (org.springframework.beans.factory.annotation.Autowired)3 LocalSessionFactoryBean (org.springframework.orm.hibernate3.LocalSessionFactoryBean)2 AnnotationSessionFactoryBean (org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean)2 DAOFactory (com.tomasio.projects.trainning.dao.DAOFactory)1 NetworkGroupDAO (com.tomasio.projects.trainning.dao.NetworkGroupDAO)1 NetworkGroupDTO (com.tomasio.projects.trainning.dto.NetworkGroupDTO)1 Session (org.hibernate.Session)1 SessionFactory (org.hibernate.SessionFactory)1 Transaction (org.hibernate.Transaction)1 SqlSessionFactoryBean (org.mybatis.spring.SqlSessionFactoryBean)1 JobExplorerFactoryBean (org.springframework.batch.core.explore.support.JobExplorerFactoryBean)1 JobRepositoryFactoryBean (org.springframework.batch.core.repository.support.JobRepositoryFactoryBean)1 FactoryBean (org.springframework.beans.factory.FactoryBean)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1