From b69152571e52c2fa2df015d63cf55fe7a9ca9da3 Mon Sep 17 00:00:00 2001 From: madorb Date: Mon, 24 Aug 2015 23:06:18 -0500 Subject: [PATCH] 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 --- .../boot/autoconfigure/batch/BasicBatchConfigurer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java index 28e93449be0..93fbc48fb44 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BasicBatchConfigurer.java @@ -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();