12.2 Configurations for Data Access

The table summarizes the configuration modules and the dependencies you should add to your build to enable them.

Table 1. Data Access Configuration Modules
DependencyDescription

io.micronaut.sql:micronaut-jdbc-dbcp

Configures SQL DataSource instances using Commons DBCP

io.micronaut.sql:micronaut-jdbc-hikari

Configures SQL DataSource instances using Hikari Connection Pool

io.micronaut.sql:micronaut-jdbc-tomcat

Configures SQL DataSource instances using Tomcat Connection Pool

io.micronaut.sql:micronaut-hibernate-jpa

Configures Hibernate/JPA EntityManagerFactory beans

io.micronaut.configuration:micronaut-hibernate-gorm

Configures GORM for Hibernate for Groovy applications

io.micronaut.mongodb:micronaut-mongo-reactive

Configures the MongoDB Reactive Driver

io.micronaut.configuration:micronaut-mongo-gorm

Configures GORM for MongoDB for Groovy applications

io.micronaut.neo4j:micronaut-neo4j-bolt

Configures the Bolt Java Driver for Neo4j

io.micronaut.configuration:micronaut-neo4j-gorm

Configures GORM for Neo4j for Groovy applications

io.micronaut.sql:micronaut-vertx-mysql-client

Configures the Reactive MySQL Client

io.micronaut.sql:micronaut-vertx-pg-client

Configures the Reactive Postgres Client

io.micronaut.redis:micronaut-redis-lettuce

Configures the Lettuce driver for Redis

io.micronaut.cassandra:micronaut-cassandra

Configures the Datastax Java Driver for Cassandra

For example, to add support for MongoDB you define the following dependency:

build.gradle

  1. compile "io.micronaut.mongodb:micronaut-mongo-reactive"

For Groovy users, Micronaut provides special support for GORM.

For GORM for Hibernate you should not have both the hibernate-jpa and hibernate-gorm dependency.

The following sections go into more detail about configuration options and the exposed beans for each implementation.