public class JPAEntityManagerContext
extends java.lang.ThreadLocal<java.util.Deque<javax.persistence.EntityManager>>
Constructor and Description |
---|
JPAEntityManagerContext() |
Modifier and Type | Method and Description |
---|---|
javax.persistence.EntityManager |
em()
Get the default EntityManager for this thread.
|
java.util.Deque<javax.persistence.EntityManager> |
emStack(boolean threadLocalFallback)
Get the EntityManager stack.
|
java.util.Deque<javax.persistence.EntityManager> |
initialValue() |
void |
pop(boolean threadLocalFallback) |
void |
push(javax.persistence.EntityManager em,
boolean threadLocalFallback) |
public java.util.Deque<javax.persistence.EntityManager> initialValue()
initialValue
in class java.lang.ThreadLocal<java.util.Deque<javax.persistence.EntityManager>>
public javax.persistence.EntityManager em()
java.lang.RuntimeException
- if no EntityManager is bound to the current Http.Context or the
current Thread.public java.util.Deque<javax.persistence.EntityManager> emStack(boolean threadLocalFallback)
threadLocalFallback
- if true, fall back to a ThreadLocal queue of entity managers if no
HTTP.Context object is found.public void push(javax.persistence.EntityManager em, boolean threadLocalFallback)
public void pop(boolean threadLocalFallback)