|
|
@ -17,6 +17,7 @@
|
|
|
|
package org.springframework.boot.autoconfigure.batch;
|
|
|
|
package org.springframework.boot.autoconfigure.batch;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
|
|
|
|
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
|
|
|
|
import org.springframework.boot.jdbc.DataSourceInitializationMode;
|
|
|
|
import org.springframework.boot.jdbc.DataSourceInitializationMode;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -25,11 +26,77 @@ import org.springframework.boot.jdbc.DataSourceInitializationMode;
|
|
|
|
* @author Stephane Nicoll
|
|
|
|
* @author Stephane Nicoll
|
|
|
|
* @author Eddú Meléndez
|
|
|
|
* @author Eddú Meléndez
|
|
|
|
* @author Vedran Pavic
|
|
|
|
* @author Vedran Pavic
|
|
|
|
|
|
|
|
* @author Mukul Kumar Chaundhyan
|
|
|
|
* @since 1.2.0
|
|
|
|
* @since 1.2.0
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ConfigurationProperties(prefix = "spring.batch")
|
|
|
|
@ConfigurationProperties(prefix = "spring.batch")
|
|
|
|
public class BatchProperties {
|
|
|
|
public class BatchProperties {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final Job job = new Job();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final Jdbc jdbc = new Jdbc();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@DeprecatedConfigurationProperty(replacement = "spring.batch.jdbc")
|
|
|
|
|
|
|
|
public String getSchema() {
|
|
|
|
|
|
|
|
return this.jdbc.getSchema();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setSchema(String schema) {
|
|
|
|
|
|
|
|
this.jdbc.setSchema(schema);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@DeprecatedConfigurationProperty(replacement = "spring.batch.jdbc")
|
|
|
|
|
|
|
|
public String getTablePrefix() {
|
|
|
|
|
|
|
|
return this.jdbc.getTablePrefix();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setTablePrefix(String tablePrefix) {
|
|
|
|
|
|
|
|
this.jdbc.setTablePrefix(tablePrefix);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@DeprecatedConfigurationProperty(replacement = "spring.batch.jdbc")
|
|
|
|
|
|
|
|
public DataSourceInitializationMode getInitializeSchema() {
|
|
|
|
|
|
|
|
return this.jdbc.getInitializeSchema();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setInitializeSchema(DataSourceInitializationMode initializeSchema) {
|
|
|
|
|
|
|
|
this.jdbc.setInitializeSchema(initializeSchema);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Job getJob() {
|
|
|
|
|
|
|
|
return this.job;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Jdbc getJdbc() {
|
|
|
|
|
|
|
|
return this.jdbc;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class Job {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Comma-separated list of job names to execute on startup (for instance,
|
|
|
|
|
|
|
|
* `job1,job2`). By default, all Jobs found in the context are executed.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private String names = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getNames() {
|
|
|
|
|
|
|
|
return this.names;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setNames(String names) {
|
|
|
|
|
|
|
|
this.names = names;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* JDBC configuration properties for Spring Batch.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @author Mukul Kumar Chaundhyan
|
|
|
|
|
|
|
|
* @since 2.5.0
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public static class Jdbc {
|
|
|
|
|
|
|
|
|
|
|
|
private static final String DEFAULT_SCHEMA_LOCATION = "classpath:org/springframework/"
|
|
|
|
private static final String DEFAULT_SCHEMA_LOCATION = "classpath:org/springframework/"
|
|
|
|
+ "batch/core/schema-@@platform@@.sql";
|
|
|
|
+ "batch/core/schema-@@platform@@.sql";
|
|
|
|
|
|
|
|
|
|
|
@ -48,8 +115,6 @@ public class BatchProperties {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private DataSourceInitializationMode initializeSchema = DataSourceInitializationMode.EMBEDDED;
|
|
|
|
private DataSourceInitializationMode initializeSchema = DataSourceInitializationMode.EMBEDDED;
|
|
|
|
|
|
|
|
|
|
|
|
private final Job job = new Job();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getSchema() {
|
|
|
|
public String getSchema() {
|
|
|
|
return this.schema;
|
|
|
|
return this.schema;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -74,26 +139,6 @@ public class BatchProperties {
|
|
|
|
this.initializeSchema = initializeSchema;
|
|
|
|
this.initializeSchema = initializeSchema;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Job getJob() {
|
|
|
|
|
|
|
|
return this.job;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class Job {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Comma-separated list of job names to execute on startup (for instance,
|
|
|
|
|
|
|
|
* `job1,job2`). By default, all Jobs found in the context are executed.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private String names = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getNames() {
|
|
|
|
|
|
|
|
return this.names;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setNames(String names) {
|
|
|
|
|
|
|
|
this.names = names;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|