# Package org.springframework.orm.hibernate5

@NonNullApi @NonNullFields package org.springframework.orm.hibernate5
Package providing integration of Hibernate ORM 5.x with Spring concepts.

This package supports Hibernate 5.x while also tolerating use against Hibernate ORM 6.x for migration purposes. Note that we strongly recommend Hibernate's native `sessionFactory.getCurrentSession()` style.

Related Packages
Package
Description
org.springframework.orm
Root package for Spring's O/R Mapping integration classes.
org.springframework.orm.hibernate5.support
Classes supporting the `org.springframework.orm.hibernate5` package.
org.springframework.orm.jpa
Package providing integration of JPA (Java Persistence API) with Spring concepts.
Class
Description
HibernateCallback<T>
Callback interface for Hibernate code.
HibernateExceptionTranslator
`PersistenceExceptionTranslator` capable of translating `HibernateException` instances to Spring's `DataAccessException` hierarchy.
HibernateJdbcException
Hibernate-specific subclass of UncategorizedDataAccessException, for JDBC exceptions that Hibernate wrapped.
HibernateObjectRetrievalFailureException
Hibernate-specific subclass of ObjectRetrievalFailureException.
HibernateOperations
Interface that specifies a common set of Hibernate operations as well as a general `HibernateOperations.execute(org.springframework.orm.hibernate5.HibernateCallback<T>)` method for Session-based lambda expressions.
HibernateOptimisticLockingFailureException
Hibernate-specific subclass of ObjectOptimisticLockingFailureException.
HibernateQueryException
Hibernate-specific subclass of InvalidDataAccessResourceUsageException, thrown on invalid HQL query syntax.
HibernateSystemException
Hibernate-specific subclass of UncategorizedDataAccessException, for Hibernate system errors that do not match any concrete `org.springframework.dao` exceptions.
HibernateTemplate
Helper class that simplifies Hibernate data access code.
HibernateTransactionManager
`PlatformTransactionManager` implementation for a single Hibernate `SessionFactory`.
LocalSessionFactoryBean
`FactoryBean` that creates a Hibernate `SessionFactory`.
LocalSessionFactoryBuilder
A Spring-provided extension of the standard Hibernate `Configuration` class, adding `SpringSessionContext` as a default and providing convenient ways to specify a JDBC `DataSource` and an application class loader.
SessionFactoryUtils
Helper class featuring methods for Hibernate Session handling.
SessionHolder
Resource holder wrapping a Hibernate `Session` (plus an optional `Transaction`).
SpringBeanContainer
Spring's implementation of Hibernate's `BeanContainer` SPI, delegating to a Spring `ConfigurableListableBeanFactory`.
SpringFlushSynchronization
Simple synchronization adapter that propagates a `flush()` call to the underlying Hibernate Session.
SpringJtaSessionContext
Spring-specific subclass of Hibernate's JTASessionContext, setting `FlushMode.MANUAL` for read-only transactions.
SpringSessionContext
Implementation of Hibernate 3.1's `CurrentSessionContext` interface that delegates to Spring's `SessionFactoryUtils` for providing a Spring-managed current `Session`.
SpringSessionSynchronization
Callback for resource cleanup at the end of a Spring-managed transaction for a pre-bound Hibernate Session.