Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

hibernate/hibernate-orm

Developer Tools

Object/relational mapping for Java that implements Jakarta Persistence, Query, and Data for database-backed applications.

6,488
3,838
Java
Apache-2.0
16 years old

What it does

Hibernate ORM maps Java objects to relational tables and exposes database data in a type-safe form. It is the reference implementation of Jakarta Persistence (formerly JPA), Jakarta Query, and Jakarta Data, and is used to write complex queries, synchronize in-memory changes with the database, keep transaction semantics, and add performance tuning after basic persistence logic is in place. Other built-in areas include temporal data and audit logging, multi-tenancy, and row-level security (1).

It fits Java applications that need to work with SQL databases without hand-writing all mapping and persistence code; it does not replace a database or provide a standalone user interface.

Get started

To add Hibernate ORM to a Java project, follow the configuration documentation, which covers dependency inclusion and database connection setup (20). The published artifacts are available from Maven Central under the org.hibernate.orm group (5).

To build the project from source, prepare a JDK 25 or newer. The build produces Java 17 bytecode and uses the Gradle wrapper (1):

cd hibernate-orm
./gradlew build

build assembles the jars and runs tests. Running ./gradlew test uses an embedded H2 database by default. For another database, start it with ./db.sh (requires Podman or Docker) and use the matching profile, for example:

./db.sh postgresql
./gradlew test -Pdb=postgresql

Stop a container when finished, for example podman stop postgresql (3). The README also lists profiles for HSQLDB, Derby, MySQL, MariaDB, PostGIS, Oracle, DB2, SQL Server, Sybase, HANA, CockroachDB, TiDB, Informix, Spanner PostgreSQL, and CUBRID (3).

Build and test constraints

Source builds require JDK 25 even though the output targets Java 17. Database profiles are selected through the db property; IDE test runs need the property expansion performed first, such as gradle clean compile -Pdb=postgresql. If a JDBC driver is not on Maven Central, add it to the local Maven repository or a personal Maven server. Container-backed databases use ./db.sh, which by default stops previously started databases; -k keeps multiple databases running (3). For remote Docker hosts, -DdbHost sets the host IP. The project is distributed under Apache-2.0.

HotRepo's take

Hibernate ORM recorded its best GitHub daily rank at 13th on the Java daily list on 2026-11-17, with no Star change reported in that snapshot. The repository has a long history, a large fork base, and a mature build and database-matrix testing setup, which makes it a reference point for JPA-style persistence in Java. The ranking record reflects visibility on one day rather than sustained ranking across periods.

Written by AI from the project's README, updated . The project's own docs are the source of truth.

Hacker News

You might also like

  1. prisma/ormTypeScript ORM letting developers query PostgreSQL and MongoDB with typed, human-readable code instead of SQL.TypeScript47,670
  2. django/djangoA high-level Python web framework for building database-backed web applications quickly with a clean, pragmatic design.Python91,548
  3. jetty/jetty.projectA lightweight Java web server and servlet engine that can run standalone or be embedded in applications.Java4,097
  4. encoredev/encoreWrite backend code in Go or TypeScript, and let Encore provision matching databases, queues and buckets in your own cloud.Go12,564
  5. supabase/supabaseA self-hostable Postgres backend platform that bundles auth, APIs, storage and realtime so small teams skip assembling them.TypeScript113,876