use of org.springframework.batch.core.repository.support.JobRepositoryFactoryBean in project RecordManager2 by moravianlibrary.
the class AppConfig method jobRepository.
@Bean
public JobRepository jobRepository() throws Exception {
JobRepositoryFactoryBean jobRepository = new JobRepositoryFactoryBean();
jobRepository.setDataSource(dataSource);
jobRepository.setTransactionManager(transactionManager());
jobRepository.afterPropertiesSet();
return (JobRepository) jobRepository.getObject();
}
use of org.springframework.batch.core.repository.support.JobRepositoryFactoryBean in project tutorials by eugenp.
the class SpringConfig method getJobRepository.
private JobRepository getJobRepository() throws Exception {
JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
factory.setDataSource(dataSource());
factory.setTransactionManager(getTransactionManager());
// JobRepositoryFactoryBean's methods Throws Generic Exception,
// it would have been better to have a specific one
factory.afterPropertiesSet();
return (JobRepository) factory.getObject();
}
use of org.springframework.batch.core.repository.support.JobRepositoryFactoryBean in project tutorials by eugenp.
the class SpringbatchPartitionConfig method getJobRepository.
private JobRepository getJobRepository() throws Exception {
JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
factory.setDataSource(dataSource());
factory.setTransactionManager(getTransactionManager());
// JobRepositoryFactoryBean's methods Throws Generic Exception,
// it would have been better to have a specific one
factory.afterPropertiesSet();
return factory.getObject();
}
use of org.springframework.batch.core.repository.support.JobRepositoryFactoryBean in project spring-boot by spring-projects.
the class BasicBatchConfigurer method createJobRepository.
protected JobRepository createJobRepository() throws Exception {
JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
PropertyMapper map = PropertyMapper.get();
map.from(this.dataSource).to(factory::setDataSource);
map.from(this::determineIsolationLevel).whenNonNull().to(factory::setIsolationLevelForCreate);
map.from(this.properties.getJdbc()::getTablePrefix).whenHasText().to(factory::setTablePrefix);
map.from(this::getTransactionManager).to(factory::setTransactionManager);
factory.afterPropertiesSet();
return factory.getObject();
}
Aggregations