org.unitils.orm.jpa.util.provider.hibernate
Class HibernateJpaProviderSupport

java.lang.Object
  extended by org.unitils.orm.jpa.util.provider.hibernate.HibernateJpaProviderSupport
All Implemented Interfaces:
JpaProviderSupport

public class HibernateJpaProviderSupport
extends Object
implements JpaProviderSupport

Implementation of JpaProviderSupport for hibernate JPA

Author:
Filip Neven, Tim Ducheyne

Constructor Summary
HibernateJpaProviderSupport()
           
 
Method Summary
 void assertMappingWithDatabaseConsistent(javax.persistence.EntityManager entityManager, Object configurationObject)
          Checks if the mapping of the JPA entities with the database is still correct.
protected  org.hibernate.dialect.Dialect getHibernateDatabaseDialect(org.hibernate.ejb.Ejb3Configuration configuration)
          Gets the database dialect from the Hibernate Ejb3Configuration
 org.springframework.instrument.classloading.LoadTimeWeaver getLoadTimeWeaver()
          If necessary for this JPA provider, return an instance of spring's LoadTimeWeaver interface, that will be set on the LocalContainerEntityManagerFactoryBean before creating the EntityManagerFactory
 Object getProviderSpecificConfigurationObject(javax.persistence.spi.PersistenceProvider persistenceProvider)
           
 org.springframework.orm.jpa.JpaVendorAdapter getSpringJpaVendorAdaptor()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateJpaProviderSupport

public HibernateJpaProviderSupport()
Method Detail

assertMappingWithDatabaseConsistent

public void assertMappingWithDatabaseConsistent(javax.persistence.EntityManager entityManager,
                                                Object configurationObject)
Checks if the mapping of the JPA entities with the database is still correct.

Specified by:
assertMappingWithDatabaseConsistent in interface JpaProviderSupport
Parameters:
entityManager - Currently active EntityManager, not null
configurationObject - Provider specific configuration object, not null

getHibernateDatabaseDialect

protected org.hibernate.dialect.Dialect getHibernateDatabaseDialect(org.hibernate.ejb.Ejb3Configuration configuration)
Gets the database dialect from the Hibernate Ejb3Configuration
Parameters:
configuration - The hibernate config, not null
Returns:
the database Dialect, not null

getSpringJpaVendorAdaptor

public org.springframework.orm.jpa.JpaVendorAdapter getSpringJpaVendorAdaptor()
Specified by:
getSpringJpaVendorAdaptor in interface JpaProviderSupport
Returns:
Implementation of spring's JpaVendorAdapter interface for this persistence provider, not null

getProviderSpecificConfigurationObject

public Object getProviderSpecificConfigurationObject(javax.persistence.spi.PersistenceProvider persistenceProvider)
Specified by:
getProviderSpecificConfigurationObject in interface JpaProviderSupport
Parameters:
persistenceProvider - The JPA PersistenceProvider that was used for creating the EntityManagerFactory, not null
Returns:
The provider specific configuration object that was used for configuring this EntityManagerFactory, not null

getLoadTimeWeaver

public org.springframework.instrument.classloading.LoadTimeWeaver getLoadTimeWeaver()
Description copied from interface: JpaProviderSupport
If necessary for this JPA provider, return an instance of spring's LoadTimeWeaver interface, that will be set on the LocalContainerEntityManagerFactoryBean before creating the EntityManagerFactory

Specified by:
getLoadTimeWeaver in interface JpaProviderSupport
Returns:
A LoadTimeWeaver, if necessary for this JPA provider, null otherwise


Copyright © 2011. All Rights Reserved.