NuoDB Hibernate Driver

Overview

NuoDB provides explicit support for Java applications using Hibernate object-relational mapping:

  • A NuoDB specific dialect for mapping to NuoDB specific SQL.

  • Custom Driver and Connection classes, specifically designed for Hibernate.

    • Allow NuoDB to throw appropriate Hibernate exceptions related to connection errors.

  • Packaged in nuodb-hibernate-XXX.jar.

However, we recommend that your applications use JPA (the Jakarta Persistence API, formerly Java Persistence API) rather than Hibernate directly.

This documentation is not meant to be a full Reference or Programming manual for Hibernate. It helps you get started with Hibernate and NuoDB.

Requirements

NuoDB supports Hibernate from version 5.6. However, because JPA 3 is a major breaking change from JPA 2, different JARs are required for Hibernate 5 and Hibernate 6. Further breaking changes in org.hibernate.orm.dialect.Dialect between versions 6.2, 6.6 and 7.2 also forced different JARs.

Make sure to use the correct NuoDB Hibernate JAR version for the version of Hibernate you are using.
Table 1. Hibernate and NuoDB JAR Requirements and Versions
Hibernate Requirements Compatibility Latest NuoDB JAR

Hibernate 7

  • JPA 3.2

  • JEE 11+

  • Spring 7, Spring Boot 4

24.0.0-hib7

Hibernate 6.6

  • JPA 3.1

  • JEE 9+

  • Spring 6, Spring Boot 3 (but both require Java 17)

23.2.0-hib6

Hibernate 6.2

  • JPA 3.1

  • JEE 9+

  • Spring 6, Spring Boot 3 (but both require Java 17)

23.0.6-hib6

Hibernate 5

  • JPA 2.1 or 2.2

  • JEE 7 or 8

  • Spring 5 and Spring Boot 2

22.0.6-hib5

Older NuoDB Hibernate 5 drivers had a direct dependency on Hibernate in order to throw the appropriate Hibernate exceptions.

  • If you try to use the driver without Hibernate JARs on the CLASSPATH, you will get a ClassNotFoundException due to the missing StateStateException class.

  • This most commonly occurs on start up when using NuoDB as a JNDI resource in Web or JEE/Jakarta containers.

From V21.0.0-hib5 the JAR has an indirect dependency, avoiding start up errors.

Installation and Versions

The Hibernate and JDBC JARs are published via Sonatype to Maven Central so that you can declare a dependency in your Gradle, Ivy or Maven build files. For the Maven URL required to download JAR files, see NuoDB Drivers.

Hibernate 7
  • NuoDB Hibernate JAR 24.0.0-hib7 supports Hibernate 7.2 and JPA 3.2

Hibernate 6
  • NuoDB Hibernate JAR 23.0.4-hib6 supports Hibernate 6.1 and JPA 3.1

  • NuoDB Hibernate JAR 23.0.6-hib6 supports Hibernate 6.1 or 6.2 and JPA 3.1

  • NuoDB Hibernate JAR 23.2.0-hib6 and 23.1.0-hib6 support Hibernate 6.6 and JPA 3.1

Hibernate 5
  • NuoDB Hibernate JAR 20.0.2-hib5 supports Hibernate 5.3 and JPA 2.1

  • NuoDB Hibernate JAR 21.0.0-hib5 supports Hibernate from 5.3 or 5.4 and JPA 2.1.

  • NuoDB Hibernate JAR 22.0.0-hib5 and later supports Hibernate from 5.3 to 5.6. Hibernate 5.5 and later supports JPA 2.2.

  • None of these JARs work with Hibernate 6.x due to all the JPA 3 package changes.

  • NuoDB Hibernate Driver JARs have a version number and release schedule independent of NuoDB releases, since version V20.0.0-hib5.

  • To manually download a local copy of the JAR, go to the Maven Repository, click on the specific version of Hibernate you need and look for Files - there should be a link to download the JAR.

  • If copying JARs directly from Maven is not permitted by your organization, our JARs are also available in the NuoDB Drivers. Customers can download it from our support portal https://support.nuodb.com.

Hibernate Dependencies

<!-- Maven POM -->
<dependency>
  <groupId>com.nuodb.hibernate</groupId>
  <artifactId>nuodb-hibernate</artifactId>
  <version>xxx-hibN</version>
</dependency>
<dependency>
  <groupId>com.nuodb.jdbc</groupId>
  <artifactId>nuodb-jdbc</artifactId>
  <version>yyy</version>
</dependency>
<!-- Gradle Build -->
compile group: 'com.nuodb.hibernate', name: 'nuodb-hibernate', version: 'xxx-hibN'
compile group: 'com.nuodb.jdbc', name: 'nuodb-jdbc', version: 'yyy'
<!-- Ivy XML -->
<dependency org="com.nuodb.hibernate" name="nuodb-hibernate" rev="xxx-hibN"/>
<dependency org="com.nuodb.jdbc" name="nuodb-jdbc" rev="yyy"/>

where:

  • xxx-hibN is the xxx version of the NuoDB Hibernate JAR for Hibernate version N.

  • yyy is the version of the NuoDB JDBC driver.

  • The version numbers xxx-hibN are subject to change as Hibernate itself releases new versions.

Note on Vulnerabilities

If you look on Maven Central it may highlight a number of supposed vulnerabilities from dependencies. These are all related to H2 database which was only used as part of the unit tests for some versions of the driver.

There are no known vulnerabilities in the JAR itself.