Update topics/database/hibernate.adoc

This commit is contained in:
Stian Thorgersen 2016-08-22 10:29:25 +02:00
parent c041991334
commit 4c39dd4c9b

22
topics/database/hibernate.adoc Executable file → Normal file
View file

@ -1,18 +1,17 @@
=== Hibernate Configuration
=== Database Configuration
The Hibernate persistence API is already pre-configured out of the box and rarely needs to be changed.
The configuration for this component lies in the _keycloak-server.json_ file. If you are running
in standalone mode, this file is in the _.../standalone/configuration_ directory. If you are running in domain mode
this file will live in the _.../domain/servers/{server name}/configuration_ directory.
The configuration for this component lies in the _keycloak-server.json_ file. If you are running in standalone mode, this file is in the _.../standalone/configuration_ directory. If you are running in domain mode this file will live in the _.../domain/servers/{server name}/configuration_ directory.
.Hibernate JPA Config
.Database Config
[source,json]
----
"connectionsJpa": {
"default": {
"dataSource": "java:jboss/datasources/KeycloakDS",
"databaseSchema": "update"
"initializeEmpty": false,
"migrationStrategy": "manual",
"migrationExport": "${jboss.home.dir}/keycloak-database-update.sql"
}
},
----
@ -29,6 +28,15 @@ driverDialect::
Value of database dialect.
In most cases you don't need to specify this property as dialect will be autodetected by Hibernate.
initializeEmpty::
Initialize database if empty. If set to false the database has to be manually initialized. If you want to manually initialize the database set migrationStrategy to `manual` which will create a file with SQL commands to initialize the database. Defaults to true.
migrationStrategy::
Strategy to use to migrate database. Valid values are `update`, `manual` and `validate`. Update will automatically migrate the database schema. Manual will export the required changes to a file with SQL commands that you can manually execute on the database. Validate will simply check if the database is up-to-date.
migrationExport::
Path for where to write manual database initialization/migration file.
databaseSchema::
Specify if schema should be updated or validated.
Valid values are `update` (default) and `validate`. The `update` value will set up or update