talira

Hibernate ORM

Idiomatic persistence for Java and relational databases

open sourceApache-2.0free

Hibernate ORM is the object/relational mapping library for Java and relational databases, more than two decades old. Beside its own native API it implements the Jakarta Persistence (JPA) specification, so it runs in Java SE applications, application servers such as WildFly and frameworks such as Quarkus. Persistent classes are plain Java with inheritance, polymorphism and collections, mapped with Jakarta Persistence annotations or XML. It has flexible fetching strategies, a two-level cache, optimistic locking with automatic versioning, the Hibernate Query Language (HQL), which Hibernate Processor validates at compile time, native SQL when needed, and temporal entities and audit logging. It is released under the Apache License 2.0 since version 7.0.

Problems it solves

  • map my Java classes to database tables without writing JDBC code
  • query relational data from Java with type-checked queries
  • keep an audit history of changes to my database rows in a Java app

Features

  • implements Jakarta Persistence (JPA) beside its native API
  • Hibernate Query Language (HQL), validated at compile time by Hibernate Processor
  • flexible fetching strategies and a two-level cache
  • optimistic locking with automatic versioning, or pessimistic locks
  • temporal entities and audit logging
  • native SQL queries in the database dialect

Alternatives

The same job

These do what Hibernate ORM does.

  1. Slick Functional Relational Mapping for Scala
  2. MyBatis SQL mapper persistence framework for Java
  3. Exposed The SQL library for Kotlin
  4. jOOQ Typesafe SQL query builder and code generator for Java
  5. Spring Data A consistent Spring programming model for data access

Compare Hibernate ORM with the top 3