spring-framework / org.springframework.orm.jpa.vendor

Package org.springframework.orm.jpa.vendor

Types

EclipseLinkJpaVendorAdapter

open class EclipseLinkJpaVendorAdapter : AbstractJpaVendorAdapter

org.springframework.orm.jpa.JpaVendorAdapter implementation for Eclipse Persistence Services (EclipseLink). Developed and tested against EclipseLink 2.4.

Exposes EclipseLink's persistence provider and EntityManager extension interface, and adapts AbstractJpaVendorAdapter's common configuration settings. No support for the detection of annotated packages (through org.springframework.orm.jpa.persistenceunit.SmartPersistenceUnitInfo#getManagedPackages()) since EclipseLink doesn't use package-level metadata.

HibernateJpaDialect

open class HibernateJpaDialect : DefaultJpaDialect

org.springframework.orm.jpa.JpaDialect implementation for Hibernate EntityManager. Developed against Hibernate 5.0/5.1/5.2.

HibernateJpaSessionFactoryBean

open class HibernateJpaSessionFactoryBean : EntityManagerFactoryAccessor, FactoryBean<SessionFactory>

Simple FactoryBean that exposes the underlying SessionFactory behind a Hibernate-backed JPA EntityManagerFactory.

Primarily available for resolving a SessionFactory by JPA persistence unit name via the "persistenceUnitName" bean property.

Note that, for straightforward cases, you could also simply declare a factory method:

 <bean id="sessionFactory" factory-bean="entityManagerFactory" factory-method="getSessionFactory"/> 

And as of JPA 2.1, EntityManagerFactory#unwrap provides a nice approach as well, in particular within configuration class arrangements:

 @Bean public SessionFactory sessionFactory(@Qualifier("entityManagerFactory") EntityManagerFactory emf) { return emf.unwrap(SessionFactory.class); } 
Please note: Since Hibernate 5.2 changed its SessionFactory interface to extend JPA's EntityManagerFactory, you may get conflicts when injecting by type, with both the original factory and your custom SessionFactory matching EntityManagerFactory. An explicit qualifier for the original factory (as indicated above) is recommended here.

HibernateJpaVendorAdapter

open class HibernateJpaVendorAdapter : AbstractJpaVendorAdapter

org.springframework.orm.jpa.JpaVendorAdapter implementation for Hibernate EntityManager. Developed and tested against Hibernate 5.0, 5.1 and 5.2; backwards-compatible with Hibernate 4.3 at runtime on a best-effort basis.

Exposes Hibernate's persistence provider and EntityManager extension interface, and adapts AbstractJpaVendorAdapter's common configuration settings. Also supports the detection of annotated packages (through org.springframework.orm.jpa.persistenceunit.SmartPersistenceUnitInfo#getManagedPackages()), e.g. containing Hibernate org.hibernate.annotations.FilterDef annotations, along with Spring-driven entity scanning which requires no persistence.xml (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean#setPackagesToScan).