Hibernate in IT — global market
Hibernate ORM is an object-relational mapping framework for Java: it maps domain-model classes to relational database tables and takes care of SQL generation, association loading and object state management. Hibernate implements the Jakarta Persistence (JPA) specification, so it can be used through the standard EntityManager and JPA annotations or through its own Session API. It is a data-access library, not a programming language or a profession.
At the centre is the Session, which corresponds to the EntityManager in Jakarta Persistence: it is the persistence context that holds loaded objects, tracks changes and synchronises them with the database. Associations are declared with annotations, and loading can be immediate (eager) or deferred (lazy). How many queries run depends on the fetch plan and on which associations are actually read: with the SELECT strategy a separate select is issued for each entity whose association has to be loaded, so traversing associations of many loaded entities gives the N+1 problem — many extra queries instead of one. It can happen with eager loading as well: the strategy, not the deferral, creates the extra queries. Lazy loading only postpones that select and saves queries when the association is never used; fetch joins, entity graphs and batch fetching reduce the number. Queries are written in HQL/JPQL, through Criteria or in native SQL.
Where Hibernate is used
- The data-access layer in Java applications and services.
- Mapping an existing relational schema to an object model.
- Transactional work with orders, payments and accounts.
- Enterprise applications whose domain model is already expressed as Java classes.
- Moving hand-written JDBC code to managed mapping and queries.
Typical work
- Declare entities, identifiers, associations and fetch strategies.
- Design transactions and session boundaries.
- Write HQL/JPQL queries and check the generated SQL.
- Find and fix the N+1 problem: fetch joins, entity graphs, batch fetching.
- Work with entity states and the behaviour of the persistence context.
Related technologies
- JUnit — testing Java applications (page planned)
- Prisma — an ORM for TypeScript, a neighbouring approach to data access (page planned)
- MS SQL Server — a relational database, a typical store for an ORM (page planned)
- Elasticsearch — full-text search, a separate layer next to a relational database (page planned)
Professions using Hibernate
This is an editorial link, not a ranking of professions.
Applications and specializations
Demand and market
Roles and careers
Pay
Geography
Work formats
Related technologies
Jobs and companies · 1,396
Who hires for Hibernate
Frequently asked questions
Short answers about the technology, without market figures.
Is Hibernate JPA?
Not exactly. Jakarta Persistence (JPA) is a specification, and Hibernate ORM is an implementation of it. You can work through the standard EntityManager and JPA annotations, or use Hibernate's own API — Session and SessionFactory — with additional features.
Is Hibernate a database?
No. It is a data-access layer: the database remains a relational DBMS, and Hibernate maps objects onto it and generates SQL. It has no storage of its own.
What are lazy loading and the N+1 problem?
Lazy loading only defers reading associated entities until they are accessed. The number of queries depends on the fetch plan: when an association is loaded by a separate select for each entity (eager or lazy), traversing the associations of many loaded entities produces N+1 — many queries instead of one. Fetch joins, entity graphs and batch fetching reduce the number of queries.
What is the difference between Session and EntityManager?
EntityManager is the Jakarta Persistence interface; Session is Hibernate's own API. They represent the same persistence context, and an EntityManager can be unwrapped into a Session. The context is not shared between threads.
Do I have to write SQL?
No. Queries can be written in HQL/JPQL, through the Criteria API or in native SQL when access to a specific database's features is needed. HQL is an object-oriented query language close to SQL.