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,java.lang.Object>

public class JpaSpringSupport
extends java.lang.Object
implements OrmSpringSupport<javax.persistence.EntityManagerFactory,java.lang.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,java.lang.Object> getConfiguredPersistenceUnit(java.lang.Object testObject)
           
protected  org.springframework.orm.jpa.AbstractEntityManagerFactoryBean getEntityManagerFactoryBean(java.lang.Object testObject)
           
protected  JpaModule getJpaModule()
           
protected  SpringModule getSpringModule()
           
 boolean isPersistenceUnitConfiguredInSpring(java.lang.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(java.lang.Object testObject)
Specified by:
isPersistenceUnitConfiguredInSpring in interface OrmSpringSupport<javax.persistence.EntityManagerFactory,java.lang.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,java.lang.Object> getConfiguredPersistenceUnit(java.lang.Object testObject)
Specified by:
getConfiguredPersistenceUnit in interface OrmSpringSupport<javax.persistence.EntityManagerFactory,java.lang.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(java.lang.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 © 2009. All Rights Reserved.