Package org.togglz.core.repository.jdbc
Class JDBCStateRepository.Builder
java.lang.Object
org.togglz.core.repository.jdbc.JDBCStateRepository.Builder
- Enclosing class:
- JDBCStateRepository
Builder for a
JDBCStateRepository.-
Constructor Summary
ConstructorsConstructorDescriptionBuilder(DataSource dataSource) Creates a new builder for creating aJDBCStateRepository. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates aJDBCStateRepositoryfrom the current configurationcreateTable(boolean createTable) If set totrue, the table will be automatically created if it is missing.noCommit(boolean noCommit) Can be used to suppress to commit after modifying data in the repository.serializer(MapSerializer serializer) TheMapSerializerfor storing parameters.Sets the table name to use for the Togglz feature state table.usePostgresTextColumns(boolean usePostgresTextColumns) If set totrue, createTable beingtrue, and running on PostgreSQL, the table will use the TEXT column type where possible.
-
Constructor Details
-
Builder
Creates a new builder for creating aJDBCStateRepository.- Parameters:
dataSource- theDataSourceTogglz should use to obtain JDBC connections
-
-
Method Details
-
tableName
Sets the table name to use for the Togglz feature state table. The default name isTOGGLZ.- Parameters:
tableName- The database table name
-
serializer
TheMapSerializerfor storing parameters. By default the repository will useDefaultMapSerializer.multiline().- Parameters:
serializer- The serializer to use
-
noCommit
Can be used to suppress to commit after modifying data in the repository. Can be useful if Togglz uses managed connections provided by a JEE container. The default isfalse.- Parameters:
noCommit-trueto suppress commits
-
createTable
If set totrue, the table will be automatically created if it is missing. The default istrue.- Parameters:
createTable-trueif the table should be created automatically
-
usePostgresTextColumns
If set totrue, createTable beingtrue, and running on PostgreSQL, the table will use the TEXT column type where possible. The default isfalse.- Parameters:
usePostgresTextColumns-trueif PostgreSQL's TEXT column type should be used
-
build
Creates aJDBCStateRepositoryfrom the current configuration
-