public interface

JpaVendorAdapter

org.springframework.orm.jpa.JpaVendorAdapter
Known Indirect Subclasses

Class Overview

SPI interface that allows to plug in vendor-specific behavior into Spring's EntityManagerFactory creators. Serves as single configuration point for all vendor-specific properties.

Summary

Public Methods
abstract Class<? extends EntityManagerFactory> getEntityManagerFactoryInterface()
Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.
abstract Class<? extends EntityManager> getEntityManagerInterface()
Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.
abstract JpaDialect getJpaDialect()
Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.
abstract Map<String, ?> getJpaPropertyMap()
Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.
abstract PersistenceProvider getPersistenceProvider()
Return the vendor-specific persistence provider.
abstract String getPersistenceProviderRootPackage()
Return the name of the persistence provider's root package (e.g.
abstract void postProcessEntityManagerFactory(EntityManagerFactory emf)
Optional callback for post-processing the native EntityManagerFactory before active use.

Public Methods

public abstract Class<? extends EntityManagerFactory> getEntityManagerFactoryInterface ()

Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.

If the provider does not offer any EntityManagerFactory extensions, the adapter should simply return the standard javax.persistence.EntityManagerFactory class here.

public abstract Class<? extends EntityManager> getEntityManagerInterface ()

Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.

If the provider does not offer any EntityManager extensions, the adapter should simply return the standard javax.persistence.EntityManager class here.

public abstract JpaDialect getJpaDialect ()

Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.

public abstract Map<String, ?> getJpaPropertyMap ()

Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.

Note that there might be further JPA properties defined on the EntityManagerFactory bean, which might potentially override individual JPA property values specified here.

Returns
  • a Map of JPA properties, as as accepted by the standard JPA bootstrap facilities, or null or an empty Map if there are no such properties to expose
See Also
  • javax.persistence.Persistence#createEntityManagerFactory(String, java.util.Map)
  • javax.persistence.spi.PersistenceProvider#createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

public abstract PersistenceProvider getPersistenceProvider ()

Return the vendor-specific persistence provider.

public abstract String getPersistenceProviderRootPackage ()

Return the name of the persistence provider's root package (e.g. "oracle.toplink.essentials"). Will be used for excluding provider classes from temporary class overriding.

public abstract void postProcessEntityManagerFactory (EntityManagerFactory emf)

Optional callback for post-processing the native EntityManagerFactory before active use.

This can be used for triggering vendor-specific initialization processes. While this is not expected to be used for most providers, it is included here as a general extension hook.