Using the NuoDB Java Hibernate Driver

Overview

NuoDB provides a Hibernate dialect (nuodb-hibernate.jar). In addition to the dialect, the nuodb-hibernate.jar file contains its own Driver and Connection classes, specifically designed for Hibernate. This is in order to be able to throw appropriate Hibernate exceptions related to connection errors. This documentation is not meant to be a full Reference or Programming manual for Hibernate. It is just meant to help you get started with Hibernate and NuoDB.

Requirements

NuoDB supports both versions 3.6.6 and 5 of Hibernate. The NuoDB JDBC driver must be installed in addition to the nuodb-hibernate.jar file.

Note: The JDBC driver requires Java 1.7 or newer. The Hibernate driver requires Java 1.8 or newer.

Installation

The Hibernate dialect and JDBC .jar files are published via Sonatype to Maven Central so that you can declare a dependency in your Ivy or Maven build files. For the Maven URL required to download .jar files, see NuoDB Drivers Available at Other Public Sites.

Note: Jars now have a version number independent of NuoDB releases, starting with version 20.0.0. Two versions are available; 20.0.0-hib3 for use with Hibernate 3.6.6, and 20.0.0-hib5 for use with Hibernate 5.

The dependency in your POM file would be as follows for these jars:

<dependency>
  <groupId>com.nuodb.hibernate</groupId>
  <artifactId>nuodb-hibernate</artifactId>
  <version>20.0.0-hib5</version>
</dependency>
<dependency>
  <groupId>com.nuodb.jdbc</groupId>
  <artifactId>nuodb-jdbc</artifactId>
  <version>20.0.0-hib5</version> <!-- or use 20.0.0-hib3 as appropriate; see note above -->
</dependency>

The version numbers are subject to change.

If you would like a local copy of the jars, you can download them manually from Maven Central (see link above). Just locate the web page for the version you require, identify the Files row in the table at the top and click the jar link.

See the following topics: