org.unitils.orm.jpa.util.spring
Class JpaSpringSupport

java.lang.Object
  extended by org.unitils.orm.jpa.util.spring.JpaSpringSupport
All Implemented Interfaces:
OrmSpringSupport<javax.persistence.EntityManagerFactory,Object>

public class JpaSpringSupport
extends Object
implements OrmSpringSupport<javax.persistence.EntityManagerFactory,Object>

Implementation of OrmSpringSupport for JPA. Enables retrieving a JPA EntityManagerFactory that was configured in a spring ApplicationContext

Author:
Filip Neven, Tim Ducheyne

Constructor Summary
JpaSpringSupport()
           
 
Method Summary
 ConfiguredOrmPersistenceUnit<javax.persistence.EntityManagerFactory,Object> getConfiguredPersistenceUnit(Object testObject)
           
protected  org.springframework.orm.jpa.AbstractEntityManagerFactoryBean getEntityManagerFactoryBean(Object testObject)
           
protected  JpaModule getJpaModule()
           
protected  SpringModule getSpringModule()
           
 boolean isPersistenceUnitConfiguredInSpring(Object testObject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpaSpringSupport

public JpaSpringSupport()
Method Detail

isPersistenceUnitConfiguredInSpring

public boolean isPersistenceUnitConfiguredInSpring(Object testObject)
Specified by:
isPersistenceUnitConfiguredInSpring in interface OrmSpringSupport<javax.persistence.EntityManagerFactory,Object>
Parameters:
testObject - The test instance, not null
Returns:
True if an ApplicationContext is associated with the given test object, and if a persistence unit of the type supported by this interface's implementation is available

getConfiguredPersistenceUnit

public ConfiguredOrmPersistenceUnit<javax.persistence.EntityManagerFactory,Object> getConfiguredPersistenceUnit(Object testObject)
Specified by:
getConfiguredPersistenceUnit in interface OrmSpringSupport<javax.persistence.EntityManagerFactory,Object>
Parameters:
testObject - The test instance, not null
Returns:
An instance of ConfiguredOrmPersistenceUnit that wraps the persistence unit and the configuration object

getEntityManagerFactoryBean

protected org.springframework.orm.jpa.AbstractEntityManagerFactoryBean getEntityManagerFactoryBean(Object testObject)
Parameters:
testObject - The test instance, not null
Returns:
Instance of LocalSessionFactoryBean that wraps the configuration of hibernate in spring

getSpringModule

protected SpringModule getSpringModule()

getJpaModule

protected JpaModule getJpaModule()


Copyright © 2011. All Rights Reserved.