Class HibernateJpaVendorAdapter

java.lang.Object
org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter
All Implemented Interfaces:
JpaVendorAdapter

public class HibernateJpaVendorAdapter extends AbstractJpaVendorAdapter
JpaVendorAdapter implementation for Hibernate. Compatible with Hibernate ORM 5.5/5.6 as well as 6.0/6.1/6.2/6.3.

Exposes Hibernate's persistence provider and Hibernate's Session as extended EntityManager interface, and adapts AbstractJpaVendorAdapter's common configuration settings. Also supports the detection of annotated packages (through SmartPersistenceUnitInfo.getManagedPackages()), e.g. containing Hibernate FilterDef annotations, along with Spring-driven entity scanning which requires no persistence.xml (LocalContainerEntityManagerFactoryBean.setPackagesToScan(java.lang.String...)).

A note about HibernateJpaVendorAdapter vs native Hibernate settings: Some settings on this adapter may conflict with native Hibernate configuration rules or custom Hibernate properties. For example, specify either AbstractJpaVendorAdapter.setDatabase(org.springframework.orm.jpa.vendor.Database) or Hibernate's "hibernate.dialect_resolvers" property, not both. Also, be careful about Hibernate's connection release mode: This adapter prefers ON_CLOSE behavior, aligned with HibernateJpaDialect.setPrepareConnection(boolean), at least for non-JTA scenarios; you may override this through corresponding native Hibernate properties.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson
See Also: