org.perfectjpattern.jee.integration.dao
Class EntityManagerAdapter
java.lang.Object
org.perfectjpattern.core.structural.AbstractSurrogate<T,A>
org.perfectjpattern.core.structural.adapter.Adapter<ISession,javax.persistence.EntityManager>
org.perfectjpattern.jee.integration.dao.EntityManagerAdapter
- All Implemented Interfaces:
- InvocationHandler, IAdapter<ISession,javax.persistence.EntityManager>, ISurrogate<ISession>
public final class EntityManagerAdapter
- extends Adapter<ISession,javax.persistence.EntityManager>
Adapts JPA's EntityManager
to the JPA implementation-free
PerfectJPattern's ISession
definition
- Version:
- $Revision: 1.0 $Date: Feb 10, 2009 8:26:06 PM $
- Author:
- Giovanni Azua
-
-
EntityManagerAdapter
public EntityManagerAdapter(javax.persistence.EntityManager anAdaptee)
throws IllegalArgumentException
- Constructs a
EntityManagerAdapter
from the Adaptee
EntityManager
instance
- Parameters:
anAdaptee
- The Adaptee EntityManager
- Throws:
IllegalArgumentException
- 'anAdaptee' must not be null
invokeUnderlying
protected Object invokeUnderlying(Method aMethod,
Object[] anArguments)
throws Throwable
- Returns the result of the Method invocation. This method has two
main purposes:
- Provides facility to invoke a method on the actual Underlying
- Concrete surrogate implementations that override this method have
a single point to control access to the actual Underlying method
invokation.
- Overrides:
invokeUnderlying
in class Adapter<ISession,javax.persistence.EntityManager>
- Parameters:
aMethod
- Method to invokeanArguments
- Array of input arguments for the Method to invoke
- Returns:
- result of the Method invocation
- Throws:
Throwable
update
public void update(Object anObject)
createQuery
public IQuery createQuery(String aSqlString)
createNativeQuery
public IQuery createNativeQuery(String aSqlString,
Class<?> aPersistentClass)
getTransaction
public ITransaction getTransaction()
Copyright © 2007-2009. All Rights Reserved.