-
Notifications
You must be signed in to change notification settings - Fork 87
guide quarkus configuration
In Quarkus, Hibernate is provided by the quarkus-hibernate-orm
extension. Ensure the extension is added to your pom.xml
as follows:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm</artifactId>
</dependency>
You additionally have to add the respective JDBC driver extension to your pom.xml
. There are different drivers for different database types. See Quarkus Hibernate guide.
You need to configure which database type you want to use, as well as the location and credentials to access it. The defaults are configured in application.properties
. The file should therefore contain the properties as in the given example:
quarkus.datasource.jdbc.url=jdbc:postgresql://database.enterprise.com/app
quarkus.datasource.username=appuser01
quarkus.datasource.password=************
quarkus.datasource.db-kind=postgresql
# drop and create the database at startup (use only for local development)
quarkus.hibernate-orm.database.generation=drop-and-create
Add the following properties to application.properties
to enable logging of database queries for debugging purposes.
quarkus.hibernate-orm.log.sql=true
quarkus.hibernate-orm.log.format-sql=true
#Logs SQL bind parameters. Setting it to true is obviously not recommended in production.
quarkus.hibernate-orm.log.bind-parameters=true
This documentation is licensed under the Creative Commons License (Attribution-NoDerivatives 4.0 International).