Search in sources :

Example 16 with HibernateTransactionManager

use of org.springframework.orm.hibernate4.HibernateTransactionManager in project Synergy by Meggot.

the class SQLDatabaseConfiguration method hibernateTransactionManager.

@Bean(name = "transactionManager")
public PlatformTransactionManager hibernateTransactionManager() {
    HibernateTransactionManager transactionManager = new HibernateTransactionManager();
    transactionManager.setSessionFactory(sessionFactory());
    return transactionManager;
}
Also used : HibernateTransactionManager(org.springframework.orm.hibernate5.HibernateTransactionManager) LocalSessionFactoryBean(org.springframework.orm.hibernate4.LocalSessionFactoryBean)

Example 17 with HibernateTransactionManager

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

the class PersistenceConfig method hibernateTransactionManager.

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

Example 18 with HibernateTransactionManager

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

the class PersistenceConfig method transactionManager.

@Bean
@Autowired
public HibernateTransactionManager transactionManager(final SessionFactory sessionFactory) {
    final HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(sessionFactory);
    return txManager;
}
Also used : HibernateTransactionManager(org.springframework.orm.hibernate3.HibernateTransactionManager) Autowired(org.springframework.beans.factory.annotation.Autowired) AnnotationSessionFactoryBean(org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 19 with HibernateTransactionManager

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

the class PersistenceConfig 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 20 with HibernateTransactionManager

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

the class Cause1PersistenceConfig 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