org.compass.gps.device.jpa.extractor
Class SpringNativeJpaExtractor

java.lang.Object
  extended by org.compass.gps.device.jpa.extractor.SpringNativeJpaExtractor
All Implemented Interfaces:
NativeJpaExtractor

public class SpringNativeJpaExtractor
extends Object
implements NativeJpaExtractor

Extracts the native entity manager factory from a managed Spring one. If Spring has not wrapped the factory, will return it as is.

Author:
kimchy

Constructor Summary
SpringNativeJpaExtractor()
           
 
Method Summary
 javax.persistence.EntityManager extractNative(javax.persistence.EntityManager entityManager)
          Extracts the native EntityManager based on the given EntityManager.
 javax.persistence.EntityManagerFactory extractNative(javax.persistence.EntityManagerFactory entityManagerFactory)
          Extracts the native entity manager factory from a managed Spring one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringNativeJpaExtractor

public SpringNativeJpaExtractor()
Method Detail

extractNative

public javax.persistence.EntityManagerFactory extractNative(javax.persistence.EntityManagerFactory entityManagerFactory)
                                                     throws JpaGpsDeviceException
Extracts the native entity manager factory from a managed Spring one. If Spring has not wrapped the factory, will return it as is.

Specified by:
extractNative in interface NativeJpaExtractor
Parameters:
entityManagerFactory - The (possibly) managed Spring entity manager factory
Returns:
The native entity manager factory
Throws:
JpaGpsDeviceException

extractNative

public javax.persistence.EntityManager extractNative(javax.persistence.EntityManager entityManager)
                                              throws JpaGpsDeviceException
Description copied from interface: NativeJpaExtractor
Extracts the native EntityManager based on the given EntityManager. Should return the same EntityManager if no wrapper has been done.

Specified by:
extractNative in interface NativeJpaExtractor
Parameters:
entityManager - The (possibly) wrapper EntityManager.
Returns:
The actual EntityManager.
Throws:
JpaGpsDeviceException


Copyright (c) 2004-2009 The Compass Project.