12.2.2 Configuring Hibernate
Setting up a Hibernate/JPA EntityManager
Using the CLI If you create your project using the Micronaut CLI, supply the
|
Micronaut includes support for configuring a Hibernate / JPA EntityManager
that builds on the SQL DataSource support.
Once you have configured one or more DataSources to use Hibernate, add the hibernate-jpa
dependency to your build:
implementation("io.micronaut.sql:micronaut-hibernate-jpa")
<dependency>
<groupId>io.micronaut.sql</groupId>
<artifactId>micronaut-hibernate-jpa</artifactId>
</dependency>
For more information see the Configuring Hibernate section of the Micronaut SQL libraries project.
Using GORM for Hibernate
For Groovy users and users familiar with the Grails framework, special support for GORM for Hibernate is available. To use GORM for Hibernate do not include Micronaut’s built-in SQL Support or the hibernate-jpa
dependency since GORM itself takes responsibility for creating the DataSource
, SessionFactory
, etc.
Using the CLI If you create your project using the Micronaut CLI, supply the
|
See the GORM Modules section of the Micronaut for Groovy user guide.