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) {