Quarkus Panache
Learn how to use Quarkus Panache and its benefits.
We'll cover the following...
Using the Hibernate ORM can be somewhat tricky and complex to work with, especially on simpler projects. That is why the Quarkus team worked on an extension to simplify the usage of Hibernate with Quarkus.
Configuration
To work with Panache we need to add the following extension, quarkus-hibernate-orm-panache
, along with the JDBC driver extension. For the purpose of simplicity, we’ll use the H2 database, which will give us the below new lines in our pom.xml
or build.gradle
files.
Press + to interact
pom.xml
build.gradle
<!-- Hibernate ORM specific dependencies --><dependency><groupId>io.quarkus</groupId><artifactId>quarkus-hibernate-orm-panache</artifactId></dependency><!-- JDBC driver dependencies --><dependency><groupId>io.quarkus</groupId><artifactId>quarkus-jdbc-h2</artifactId></dependency>
Using Panache
When using the Quarkus Panache extension, we can pick one of the two available patterns: the active record pattern or the repository pattern.