nl.knowledgeplaza.util.jpa
Class EntityManagerFinderThread

java.lang.Object
  extended by nl.knowledgeplaza.util.jpa.EntityManagerFinder
      extended by nl.knowledgeplaza.util.jpa.EntityManagerFinderThread
Direct Known Subclasses:
EntityManagerFinderSwing

public class EntityManagerFinderThread
extends EntityManagerFinder

Store an entity manager related to a thread.

Version:
$Revision: 1.4 $

Constructor Summary
EntityManagerFinderThread()
           
 
Method Summary
static void associate(javax.persistence.EntityManager entityManager, Thread thread)
           
static void associateWithCurrentThread(javax.persistence.EntityManager entityManager)
           
static void deassociate(Thread thread)
           
static void deassociate(Thread thread, javax.persistence.EntityManager currentEntityManager)
           
static void deassociateFromCurrentThread()
           
static void deassociateFromCurrentThread(javax.persistence.EntityManager entityManager)
           
 javax.persistence.EntityManager getEntityManager(Object context)
           
static void register()
           
static void runAssociatedWithCurrentThread(javax.persistence.EntityManager entityManager, Runnable runnable)
          small utility method that binds the EM to the current thread, then runs the runnable and then makes sure the EM is unbound
 
Methods inherited from class nl.knowledgeplaza.util.jpa.EntityManagerFinder
find, find, findEntityManager, getEMAssociation, getEMAssociation, getEntityManagerFinder, removeAssociation, removeEMAssociation, setEMAssociation, setEMAssociation, setEntityManagerFinder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityManagerFinderThread

public EntityManagerFinderThread()
Method Detail

getEntityManager

public javax.persistence.EntityManager getEntityManager(Object context)
Specified by:
getEntityManager in class EntityManagerFinder

register

public static void register()

associate

public static void associate(javax.persistence.EntityManager entityManager,
                             Thread thread)

associateWithCurrentThread

public static void associateWithCurrentThread(javax.persistence.EntityManager entityManager)

deassociate

public static void deassociate(Thread thread,
                               javax.persistence.EntityManager currentEntityManager)

deassociate

public static void deassociate(Thread thread)

deassociateFromCurrentThread

public static void deassociateFromCurrentThread()

deassociateFromCurrentThread

public static void deassociateFromCurrentThread(javax.persistence.EntityManager entityManager)

runAssociatedWithCurrentThread

public static void runAssociatedWithCurrentThread(javax.persistence.EntityManager entityManager,
                                                  Runnable runnable)
small utility method that binds the EM to the current thread, then runs the runnable and then makes sure the EM is unbound

Parameters:
entityManager -
runnable -


Copyright © 2012 KnowledgePlaza. All Rights Reserved.