Search in sources :

Example 1 with HibernateTransactionManager

use of org.springframework.orm.hibernate4.HibernateTransactionManager in project rhino by PLOS.

the class TestConfiguration method transactionManager.

@Bean
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
    HibernateTransactionManager manager = new HibernateTransactionManager();
    manager.setSessionFactory(sessionFactory);
    return manager;
}
Also used : HibernateTransactionManager(org.springframework.orm.hibernate3.HibernateTransactionManager) LocalSessionFactoryBean(org.springframework.orm.hibernate3.LocalSessionFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with HibernateTransactionManager

use of org.springframework.orm.hibernate4.HibernateTransactionManager in project RecordManager2 by moravianlibrary.

the class AppConfig method transactionManager.

@Bean
public PlatformTransactionManager transactionManager() {
    HibernateTransactionManager manager = new HibernateTransactionManager();
    manager.setSessionFactory(sessionFactory);
    return manager;
}
Also used : HibernateTransactionManager(org.springframework.orm.hibernate4.HibernateTransactionManager) JobRepositoryFactoryBean(org.springframework.batch.core.repository.support.JobRepositoryFactoryBean) JobExplorerFactoryBean(org.springframework.batch.core.explore.support.JobExplorerFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 3 with HibernateTransactionManager

use of org.springframework.orm.hibernate4.HibernateTransactionManager in project yqq by yeycfri.

the class HibernateConfig method transactionManager.

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

Example 4 with HibernateTransactionManager

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

the class HibernateConf 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 5 with HibernateTransactionManager

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

the class PersistenceConfigHibernate3 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) LocalSessionFactoryBean(org.springframework.orm.hibernate3.LocalSessionFactoryBean) Bean(org.springframework.context.annotation.Bean)

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