Polish contribution

Closes gh-6651
This commit is contained in:
Stephane Nicoll 2016-09-12 14:53:02 +02:00
parent 06a1f44128
commit ee668e6782
2 changed files with 11 additions and 6 deletions

View File

@ -73,15 +73,20 @@ public class BatchProperties {
public class Initializer {
/**
* Create the required batch tables on startup if necessary.
* Create the required batch tables on startup if necessary. Enabled
* automatically if no custom table prefix is set or if a custom schema is
* configured.
*/
private boolean enabled = true;
private Boolean enabled;
public boolean isEnabled() {
boolean isDefaultTablePrefix = BatchProperties.this.getTablePrefix() == null;
boolean isDefaultSchema = DEFAULT_SCHEMA_LOCATION.equals(
if (this.enabled != null) {
return this.enabled;
}
boolean defaultTablePrefix = BatchProperties.this.getTablePrefix() == null;
boolean customSchema = !DEFAULT_SCHEMA_LOCATION.equals(
BatchProperties.this.getSchema());
return this.enabled && (isDefaultTablePrefix || !isDefaultSchema);
return (defaultTablePrefix || customSchema);
}
public void setEnabled(boolean enabled) {

View File

@ -847,7 +847,7 @@ content into your application; rather pick only the properties that you need.
spring.artemis.user= # Login user of the broker.
# SPRING BATCH ({sc-spring-boot-autoconfigure}/batch/BatchProperties.{sc-ext}[BatchProperties])
spring.batch.initializer.enabled=true # Create the required batch tables on startup if necessary.
spring.batch.initializer.enabled= # Create the required batch tables on startup if necessary. Enabled automatically if no custom table prefix is set or if a custom schema is configured.
spring.batch.job.enabled=true # Execute all Spring Batch jobs in the context on startup.
spring.batch.job.names= # Comma-separated list of job names to execute on startup (For instance `job1,job2`). By default, all Jobs found in the context are executed.
spring.batch.schema=classpath:org/springframework/batch/core/schema-@@platform@@.sql # Path to the SQL file to use to initialize the database schema.