12.2 Configurations for Data Access

This table summarizes the configuration modules and dependencies to add to your build to enable them:

Table 1. Data Access Configuration Modules
DependencyDescription

io.micronaut.sql:micronaut-jdbc-dbcp

Configures SQL DataSources using Commons DBCP

io.micronaut.sql:micronaut-jdbc-hikari

Configures SQL DataSources using Hikari Connection Pool

io.micronaut.sql:micronaut-jdbc-tomcat

Configures SQL DataSources using Tomcat Connection Pool

io.micronaut.sql:micronaut-hibernate-jpa

Configures Hibernate/JPA EntityManagerFactory beans

io.micronaut.groovy:micronaut-hibernate-gorm

Configures GORM for Hibernate for Groovy applications

io.micronaut.mongodb:micronaut-mongo-reactive

Configures the MongoDB Reactive Driver

io.micronaut.groovy: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.groovy: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, add the following dependency:

build.gradle

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

For Groovy users, Micronaut provides special support for GORM.

With GORM for Hibernate you cannot have both the hibernate-jpa and hibernate-gorm dependencies.

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