parent
9141177f1a
commit
a347a780e7
|
|
@ -144,16 +144,21 @@ public class SessionProperties {
|
||||||
public class Initializer {
|
public class Initializer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the required session tables on startup if necessary.
|
* Create the required session tables on startup if necessary. Enabled
|
||||||
|
* automatically if the default table name is set or a custom schema is
|
||||||
|
* configured.
|
||||||
*/
|
*/
|
||||||
private boolean enabled = true;
|
private Boolean enabled;
|
||||||
|
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
boolean isDefaultTableName = DEFAULT_TABLE_NAME.equals(
|
if (this.enabled != null) {
|
||||||
|
return this.enabled;
|
||||||
|
}
|
||||||
|
boolean defaultTableName = DEFAULT_TABLE_NAME.equals(
|
||||||
Jdbc.this.getTableName());
|
Jdbc.this.getTableName());
|
||||||
boolean isDefaultSchema = DEFAULT_SCHEMA_LOCATION.equals(
|
boolean customSchema = !DEFAULT_SCHEMA_LOCATION.equals(
|
||||||
Jdbc.this.getSchema());
|
Jdbc.this.getSchema());
|
||||||
return this.enabled && (isDefaultTableName || !isDefaultSchema);
|
return (defaultTableName || customSchema);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
|
|
|
||||||
|
|
@ -369,7 +369,7 @@ content into your application; rather pick only the properties that you need.
|
||||||
|
|
||||||
# SPRING SESSION ({sc-spring-boot-autoconfigure}/session/SessionProperties.{sc-ext}[SessionProperties])
|
# SPRING SESSION ({sc-spring-boot-autoconfigure}/session/SessionProperties.{sc-ext}[SessionProperties])
|
||||||
spring.session.hazelcast.map-name=spring:session:sessions # Name of the map used to store sessions.
|
spring.session.hazelcast.map-name=spring:session:sessions # Name of the map used to store sessions.
|
||||||
spring.session.jdbc.initializer.enabled=true # Create the required session tables on startup if necessary.
|
spring.session.jdbc.initializer.enabled= # Create the required session tables on startup if necessary. Enabled automatically if the default table name is set or a custom schema is configured.
|
||||||
spring.session.jdbc.schema=classpath:org/springframework/session/jdbc/schema-@@platform@@.sql # Path to the SQL file to use to initialize the database schema.
|
spring.session.jdbc.schema=classpath:org/springframework/session/jdbc/schema-@@platform@@.sql # Path to the SQL file to use to initialize the database schema.
|
||||||
spring.session.jdbc.table-name=SPRING_SESSION # Name of database table used to store sessions.
|
spring.session.jdbc.table-name=SPRING_SESSION # Name of database table used to store sessions.
|
||||||
spring.session.mongo.collection-name=sessions # Collection name used to store sessions.
|
spring.session.mongo.collection-name=sessions # Collection name used to store sessions.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue