cuba.wired.jpa
Class WiredManagedEntityManager

java.lang.Object
  extended by cuba.wired.jpa.WiredManagedEntityManager
All Implemented Interfaces:
CubaEntityManager, javax.persistence.EntityManager

public class WiredManagedEntityManager
extends java.lang.Object
implements javax.persistence.EntityManager, CubaEntityManager

This class is a thin wrapper around javax.persistence.EntityManager. It is needed for 2 purposes: 1) It implements CubaEntityManager, which is required to make the CUBA core independent from JPA classes and interfaces 2) It wraps the Method of the persistence providers EntityManager implementation, that allows for example to ensure that close() is not called on container managed EntityManagers

Author:
mbartels

Constructor Summary
WiredManagedEntityManager(javax.persistence.EntityManager em)
           
 
Method Summary
 void clear()
           
 void close()
           
 boolean contains(java.lang.Object arg0)
           
 javax.persistence.Query createNamedQuery(java.lang.String arg0)
           
 javax.persistence.Query createNativeQuery(java.lang.String arg0)
           
 javax.persistence.Query createNativeQuery(java.lang.String arg0, java.lang.Class arg1)
           
 javax.persistence.Query createNativeQuery(java.lang.String arg0, java.lang.String arg1)
           
 javax.persistence.Query createQuery(java.lang.String arg0)
           
<T> T
find(java.lang.Class<T> arg0, java.lang.Object arg1)
           
 void flush()
           
 java.lang.Object getDelegate()
           
 javax.persistence.FlushModeType getFlushMode()
           
<T> T
getReference(java.lang.Class<T> arg0, java.lang.Object arg1)
           
 javax.persistence.EntityTransaction getTransaction()
           
 boolean isOpen()
           
 void joinTransaction()
           
 void lock(java.lang.Object arg0, javax.persistence.LockModeType arg1)
           
<T> T
merge(T arg0)
           
 void persist(java.lang.Object arg0)
           
 void refresh(java.lang.Object arg0)
           
 void remove(java.lang.Object arg0)
           
 void setFlushMode(javax.persistence.FlushModeType arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WiredManagedEntityManager

public WiredManagedEntityManager(javax.persistence.EntityManager em)
Method Detail

clear

public void clear()
Specified by:
clear in interface javax.persistence.EntityManager

close

public void close()
Specified by:
close in interface javax.persistence.EntityManager

contains

public boolean contains(java.lang.Object arg0)
Specified by:
contains in interface javax.persistence.EntityManager

createNamedQuery

public javax.persistence.Query createNamedQuery(java.lang.String arg0)
Specified by:
createNamedQuery in interface javax.persistence.EntityManager

createNativeQuery

public javax.persistence.Query createNativeQuery(java.lang.String arg0,
                                                 java.lang.Class arg1)
Specified by:
createNativeQuery in interface javax.persistence.EntityManager

createNativeQuery

public javax.persistence.Query createNativeQuery(java.lang.String arg0,
                                                 java.lang.String arg1)
Specified by:
createNativeQuery in interface javax.persistence.EntityManager

createNativeQuery

public javax.persistence.Query createNativeQuery(java.lang.String arg0)
Specified by:
createNativeQuery in interface javax.persistence.EntityManager

createQuery

public javax.persistence.Query createQuery(java.lang.String arg0)
Specified by:
createQuery in interface javax.persistence.EntityManager

find

public <T> T find(java.lang.Class<T> arg0,
                  java.lang.Object arg1)
Specified by:
find in interface javax.persistence.EntityManager

flush

public void flush()
Specified by:
flush in interface javax.persistence.EntityManager

getDelegate

public java.lang.Object getDelegate()
Specified by:
getDelegate in interface javax.persistence.EntityManager

getFlushMode

public javax.persistence.FlushModeType getFlushMode()
Specified by:
getFlushMode in interface javax.persistence.EntityManager

getReference

public <T> T getReference(java.lang.Class<T> arg0,
                          java.lang.Object arg1)
Specified by:
getReference in interface javax.persistence.EntityManager

getTransaction

public javax.persistence.EntityTransaction getTransaction()
Specified by:
getTransaction in interface javax.persistence.EntityManager

isOpen

public boolean isOpen()
Specified by:
isOpen in interface javax.persistence.EntityManager

joinTransaction

public void joinTransaction()
Specified by:
joinTransaction in interface javax.persistence.EntityManager

lock

public void lock(java.lang.Object arg0,
                 javax.persistence.LockModeType arg1)
Specified by:
lock in interface javax.persistence.EntityManager

merge

public <T> T merge(T arg0)
Specified by:
merge in interface javax.persistence.EntityManager

persist

public void persist(java.lang.Object arg0)
Specified by:
persist in interface javax.persistence.EntityManager

refresh

public void refresh(java.lang.Object arg0)
Specified by:
refresh in interface javax.persistence.EntityManager

remove

public void remove(java.lang.Object arg0)
Specified by:
remove in interface javax.persistence.EntityManager

setFlushMode

public void setFlushMode(javax.persistence.FlushModeType arg0)
Specified by:
setFlushMode in interface javax.persistence.EntityManager