public abstract class

AbstractJpaVendorAdapter

extends Object
implements JpaVendorAdapter
java.lang.Object
   ↳ org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter
Known Direct Subclasses

Class Overview

Abstract JpaVendorAdapter implementation that defines common properties, to be translated into vendor-specific JPA properties by concrete subclasses.

Summary

Public Constructors
AbstractJpaVendorAdapter()
Public Methods
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.
JpaDialect getJpaDialect()
Return the vendor-specific JpaDialect implementation for this provider, or null if there is none.
Map<String, ?> getJpaPropertyMap()
Return a Map of vendor-specific JPA properties, typically based on settings in this JpaVendorAdapter instance.
String getPersistenceProviderRootPackage()
Return the name of the persistence provider's root package (e.g.
void postProcessEntityManagerFactory(EntityManagerFactory emf)
Post-process the EntityManagerFactory after it has been initialized.
void setDatabase(Database database)
Specify the target database to operate on, as a value of the Database enum: DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE
void setDatabasePlatform(String databasePlatform)
Specify the name of the target database to operate on.
void setGenerateDdl(boolean generateDdl)
Set whether to generate DDL after the EntityManagerFactory has been initialized, creating/updating all relevant tables.
void setShowSql(boolean showSql)
Set whether to show SQL in the log (or in the console).
Protected Methods
Database getDatabase()
Return the target database to operate on.
String getDatabasePlatform()
Return the name of the target database to operate on.
boolean isGenerateDdl()
Return whether to generate DDL after the EntityManagerFactory has been initialized creating/updating all relevant tables.
boolean isShowSql()
Return whether to show SQL in the log (or in the console).
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.orm.jpa.JpaVendorAdapter

Public Constructors

public AbstractJpaVendorAdapter ()

Public Methods

public 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 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 JpaDialect getJpaDialect ()

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

public 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

public 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 void postProcessEntityManagerFactory (EntityManagerFactory emf)

Post-process the EntityManagerFactory after it has been initialized.

Parameters
emf the EntityManagerFactory to process

public void setDatabase (Database database)

Specify the target database to operate on, as a value of the Database enum: DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE

public void setDatabasePlatform (String databasePlatform)

Specify the name of the target database to operate on. The supported values are vendor-dependent platform identifiers.

public void setGenerateDdl (boolean generateDdl)

Set whether to generate DDL after the EntityManagerFactory has been initialized, creating/updating all relevant tables.

Note that the exact semantics of this flag depend on the underlying persistence provider. For any more advanced needs, specify the appropriate vendor-specific settings as "jpaProperties".

public void setShowSql (boolean showSql)

Set whether to show SQL in the log (or in the console).

For more specific logging configuration, specify the appropriate vendor-specific settings as "jpaProperties".

Protected Methods

protected Database getDatabase ()

Return the target database to operate on.

protected String getDatabasePlatform ()

Return the name of the target database to operate on.

protected boolean isGenerateDdl ()

Return whether to generate DDL after the EntityManagerFactory has been initialized creating/updating all relevant tables.

protected boolean isShowSql ()

Return whether to show SQL in the log (or in the console).