List of usage examples for org.springframework.batch.core.repository.support JobRepositoryFactoryBean setTablePrefix
public void setTablePrefix(String tablePrefix)
From source file:de.codecentric.batch.configuration.TaskExecutorBatchConfigurer.java
protected JobRepository createJobRepository() throws Exception { JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(dataSource);// w w w .ja v a 2s . c om factory.setTransactionManager(transactionManager); String isolationLevelForCreate = env.getProperty("batch.repository.isolationlevelforcreate"); if (isolationLevelForCreate != null) { factory.setIsolationLevelForCreate(isolationLevelForCreate); } String tablePrefix = env.getProperty("batch.repository.tableprefix"); if (tablePrefix != null) { factory.setTablePrefix(tablePrefix); } factory.afterPropertiesSet(); return factory.getObject(); }
From source file:org.springframework.boot.autoconfigure.batch.BasicBatchConfigurer.java
protected JobRepository createJobRepository() throws Exception { JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean(); factory.setDataSource(this.dataSource); if (this.entityManagerFactory != null) { logger.warn(// ww w . j av a 2s .com "JPA does not support custom isolation levels, so locks may not be taken when launching Jobs"); factory.setIsolationLevelForCreate("ISOLATION_DEFAULT"); } String tablePrefix = this.properties.getTablePrefix(); if (StringUtils.hasText(tablePrefix)) { factory.setTablePrefix(tablePrefix); } factory.setTransactionManager(getTransactionManager()); factory.afterPropertiesSet(); return factory.getObject(); }