use of org.springframework.context.annotation.Bean in project rhino by PLOS.
the class RhinoConfiguration method sessionFactory.
@Bean
public AnnotationSessionFactoryBean sessionFactory(DataSource hibernateDataSource) throws IOException {
// May be switched to true in a dev environment to log SQL code generated by Hibernate.
// Could be replaced with environmental config if needed.
final boolean hibernateIsInDebugMode = false;
AnnotationSessionFactoryBean bean = new AnnotationSessionFactoryBean();
bean.setDataSource(hibernateDataSource);
Properties hibernateProperties = new Properties();
hibernateProperties.setProperty("hibernate.dialect", org.hibernate.dialect.MySQLDialect.class.getName());
hibernateProperties.setProperty("hibernate.show_sql", Boolean.toString(hibernateIsInDebugMode));
hibernateProperties.setProperty("hibernate.format_sql", Boolean.toString(hibernateIsInDebugMode));
bean.setHibernateProperties(hibernateProperties);
bean.setPackagesToScan("org.ambraproject.rhino.model");
return bean;
}
use of org.springframework.context.annotation.Bean in project Activiti by Activiti.
the class JPAActivitiEngineConfiguration method processEngineConfiguration.
@Bean(name = "processEngineConfiguration")
public ProcessEngineConfigurationImpl processEngineConfiguration() {
SpringProcessEngineConfiguration processEngineConfiguration = new SpringProcessEngineConfiguration();
processEngineConfiguration.setDataSource(dataSource);
processEngineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
processEngineConfiguration.setTransactionManager(transactionManager);
processEngineConfiguration.setJobExecutorActivate(false);
processEngineConfiguration.setAsyncExecutorEnabled(true);
processEngineConfiguration.setAsyncExecutorActivate(false);
processEngineConfiguration.setJpaEntityManagerFactory(entityManagerFactory);
processEngineConfiguration.setJpaHandleTransaction(false);
processEngineConfiguration.setJpaHandleTransaction(false);
processEngineConfiguration.setHistoryLevel(HistoryLevel.FULL);
return processEngineConfiguration;
}
use of org.springframework.context.annotation.Bean in project Activiti by Activiti.
the class JPAActivitiEngineConfiguration method processEngineFactoryBean.
@Bean(name = "processEngineFactoryBean")
public ProcessEngineFactoryBean processEngineFactoryBean() {
ProcessEngineFactoryBean factoryBean = new ProcessEngineFactoryBean();
factoryBean.setProcessEngineConfiguration(processEngineConfiguration());
return factoryBean;
}
use of org.springframework.context.annotation.Bean in project Activiti by Activiti.
the class ActivitiEngineConfiguration method annotationDrivenTransactionManager.
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager() {
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
transactionManager.setDataSource(dataSource());
return transactionManager;
}
use of org.springframework.context.annotation.Bean in project Activiti by Activiti.
the class ActivitiEngineConfiguration method processEngineFactoryBean.
@Bean(name = "processEngineFactoryBean")
public ProcessEngineFactoryBean processEngineFactoryBean() {
ProcessEngineFactoryBean factoryBean = new ProcessEngineFactoryBean();
factoryBean.setProcessEngineConfiguration(processEngineConfiguration());
return factoryBean;
}
Aggregations