Hibernate ORM

Getting started with Hibernate ORM

This page lists just the basic information needed to get up and running with Hibernate ORM 5.

If you are approaching Hibernate for the first time, the Getting Started Guide is the best place to start.

More thorough information is presented in the User Guide.

System Requirements

Hibernate 5.2 and later versions require at least Java 1.8 and JDBC 4.2.

Hibernate 5.1 and older versions require at least Java 1.6 and JDBC 4.0.

When building Hibernate 5.1 or older from sources, you need Java 1.7 due to a bug in the JDK 1.6 compiler.

Dependency Management

It is highly recommended to consume Hibernate ORM artifacts through a dependency management tool. The artifacts can be found in Maven’s central repository but are released first in the JBoss maven repository.

Snapshots are only pushed to the JBoss snapshot repository, so if you want to use SNAPSHOT versions be sure to add the JBoss snapshot repository properly according to your build tool of choice.

The main Hibernate ORM artifact is named hibernate-core. If you want to use the Jakarta JPA APIs you can us the hibernate-core-jakarta artifact.

There are also a number of optional artifacts based on what specific features you wish to use. These are discussed in the Getting Started Guide.

To use Hibernate ORM in your own project you just need to name a dependency on it in your project.

From Maven
<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-core</artifactId>
   <version>6.5.0.Final</version>
</dependency>
From Gradle
org.hibernate:hibernate-core:6.5.0.Final

Or in case you want to use the Jakarta JPA API:

From Maven
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core-jakarta</artifactId>
    <version>6.5.0.Final</version>
</dependency>
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>3.0.0</version>
</dependency>
From Gradle
org.hibernate:hibernate-core-jakarta:6.5.0.Final
org.glassfish.jaxb:jaxb-runtime:3.0.0

Note that you need a Jakarta XML Binding implementation when you want to use the Jakarta JPA version.

Back to top