Browse Source

Consistently apply table prefix

Make sure that if a custom table prefix is specified, it is set on the
JobRepository as well.

Closes gh-3798
pull/3844/head
madorb 11 years ago committed by Stephane Nicoll
parent
commit
b69152571e
  1. 4
      spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java

4
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java

@ -140,6 +140,10 @@ class BasicBatchConfigurer implements BatchConfigurer { @@ -140,6 +140,10 @@ class BasicBatchConfigurer implements BatchConfigurer {
logger.warn("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();

Loading…
Cancel
Save