Browse Source

Polish contribution

Closes gh-6651
pull/6870/head
Stephane Nicoll 10 years ago
parent
commit
ee668e6782
  1. 15
      spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchProperties.java
  2. 2
      spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

15
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchProperties.java

@ -73,15 +73,20 @@ public class BatchProperties { @@ -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) {

2
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

@ -847,7 +847,7 @@ content into your application; rather pick only the properties that you need. @@ -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.

Loading…
Cancel
Save