Class OpenJpaVendorAdapter
- java.lang.Object
- org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
- org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter
- All Implemented Interfaces:
JpaVendorAdapter
public class OpenJpaVendorAdapter extends AbstractJpaVendorAdapter
JpaVendorAdapter
implementation for Apache OpenJPA. Developed and tested against OpenJPA 2.2.Exposes OpenJPA's persistence provider and EntityManager extension interface, and adapts
AbstractJpaVendorAdapter
's common configuration settings. No support for the detection of annotated packages (throughSmartPersistenceUnitInfo.getManagedPackages()
) since OpenJPA doesn't use package-level metadata.- Since:
- 2.0
- Author:
- Juergen Hoeller, Costin Leau
- See Also:
OpenJpaDialect
,PersistenceProviderImpl
,OpenJPAEntityManager
Constructor Summary
Constructors Constructor Description OpenJpaVendorAdapter()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
determineDatabaseDictionary(Database database)
Determine the OpenJPA database dictionary name for the given database.Class<? extends EntityManagerFactory>
getEntityManagerFactoryInterface()
Return the vendor-specific EntityManagerFactory interface that the EntityManagerFactory proxy is supposed to implement.Class<? extends EntityManager>
getEntityManagerInterface()
Return the vendor-specific EntityManager interface that this provider's EntityManagers will implement.OpenJpaDialect
getJpaDialect()
Return the vendor-specific JpaDialect implementation for this provider, ornull
if there is none.Map<String,Object>
getJpaPropertyMap()
Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.PersistenceProvider
getPersistenceProvider()
Return the vendor-specific persistence provider.String
getPersistenceProviderRootPackage()
Return the name of the persistence provider's root package (e.g.Methods inherited from class org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
getDatabase, getDatabasePlatform, getJpaPropertyMap, isGenerateDdl, isShowSql, postProcessEntityManagerFactory, setDatabase, setDatabasePlatform, setGenerateDdl, setShowSql
Constructor Detail
OpenJpaVendorAdapter
public OpenJpaVendorAdapter()
Method Detail
getPersistenceProvider
public PersistenceProvider getPersistenceProvider()
Description copied from interface:JpaVendorAdapter
Return the vendor-specific persistence provider.
getPersistenceProviderRootPackage
public String getPersistenceProviderRootPackage()
Description copied from interface:JpaVendorAdapter
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.- Specified by:
getPersistenceProviderRootPackage
in interfaceJpaVendorAdapter
- Overrides:
getPersistenceProviderRootPackage
in classAbstractJpaVendorAdapter
getJpaPropertyMap
public Map<String,Object> getJpaPropertyMap()
Description copied from interface:JpaVendorAdapter
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.
- Specified by:
getJpaPropertyMap
in interfaceJpaVendorAdapter
- Overrides:
getJpaPropertyMap
in classAbstractJpaVendorAdapter
- Returns:
- a Map of JPA properties, as accepted by the standard JPA bootstrap facilities, or an empty Map if there are no properties to expose
- See Also:
Persistence.createEntityManagerFactory(String, Map)
determineDatabaseDictionary
protected String determineDatabaseDictionary(Database database)
Determine the OpenJPA database dictionary name for the given database.- Parameters:
database
- the specified database- Returns:
- the OpenJPA database dictionary name, or
null
if none found
getJpaDialect
public OpenJpaDialect getJpaDialect()
Description copied from interface:JpaVendorAdapter
Return the vendor-specific JpaDialect implementation for this provider, ornull
if there is none.- Specified by:
getJpaDialect
in interfaceJpaVendorAdapter
- Overrides:
getJpaDialect
in classAbstractJpaVendorAdapter
getEntityManagerFactoryInterface
public Class<? extends EntityManagerFactory> getEntityManagerFactoryInterface()
Description copied from interface:JpaVendorAdapter
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
EntityManagerFactory
class here.- Specified by:
getEntityManagerFactoryInterface
in interfaceJpaVendorAdapter
- Overrides:
getEntityManagerFactoryInterface
in classAbstractJpaVendorAdapter
getEntityManagerInterface
public Class<? extends EntityManager> getEntityManagerInterface()
Description copied from interface:JpaVendorAdapter
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
EntityManager
class here.- Specified by:
getEntityManagerInterface
in interfaceJpaVendorAdapter
- Overrides:
getEntityManagerInterface
in classAbstractJpaVendorAdapter