keycloak-scim/topics/database/hibernate.adoc

53 lines
1.8 KiB
Text
Raw Normal View History

2016-04-27 21:01:22 +00:00
=== Hibernate Configuration
2016-04-29 16:09:09 +00:00
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
2016-04-27 21:01:22 +00:00
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
[source,json]
----
"connectionsJpa": {
"default": {
"dataSource": "java:jboss/datasources/KeycloakDS",
"databaseSchema": "update"
}
},
----
Possible configuration options are:
dataSource::
JNDI name of the dataSource
jta::
boolean property to specify if datasource is JTA capable
driverDialect::
Value of database dialect.
In most cases you don't need to specify this property as dialect will be autodetected by Hibernate.
databaseSchema::
Specify if schema should be updated or validated.
2016-04-29 20:12:12 +00:00
Valid values are `update` (default) and `validate`. The `update` value will set up or update
the table definitions that {{book.project.name}} needs. `validate` just makes sure that the database has
2016-04-27 21:01:22 +00:00
the appropriate table definitions set up.
showSql::
Specify whether Hibernate should show all SQL commands in the console (false by default). This is very verbose!
formatSql::
Specify whether Hibernate should format SQL commands (true by default)
globalStatsInterval::
Will log global statistics from Hibernate about executed DB queries and other things.
Statistics are always reported to server log at specified interval (in seconds) and are cleared after each report.
schema::
Specify the database schema to use
2016-04-27 21:09:21 +00:00
NOTE: All these configuration switches and more are described in the link:{{book.jpa.admindoc.link}}[the Hibernate chapter]
of {{book.jpa.admindoc.name}}.
2016-04-27 21:01:22 +00:00