What Is Hibernate?
Hibernate is what lets Java code work with database rows as ordinary objects, instead of hand-writing SQL for every query.
What Is Hibernate?
Hibernate is an Object-Relational Mapping (ORM) framework for Java. It maps Java classes to database tables and Java object fields to table columns, so you can save, update, delete, and query data by working with regular Java objects -- Hibernate generates and executes the underlying SQL for you.
What Hibernate Actually Does
- Maps a @Entity-annotated Java class to a database table
- Generates SQL for CRUD operations automatically
- Tracks changes to loaded objects and writes them back on transaction commit (the "dirty checking" pattern)
- Manages relationships between entities (one-to-many, many-to-many) without manual join SQL
- Provides its own query language, HQL, alongside support for native SQL when needed
Hibernate and JPA
JPA (Jakarta Persistence API) is a specification -- a set of interfaces and annotations that define how Java ORMs should behave. Hibernate is the most widely used implementation of that specification. In practice, most Spring Boot applications (including this one) code against the JPA annotations and interfaces, with Hibernate doing the actual work underneath.