|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.knowledgeplaza.util.jpa.EntityManagerExtender
public class EntityManagerExtender
The disconnected usage of the EM requires that prior to storing or removing the toplevel entity a clear must be called, then the toplevel entity is stored/removed and is propogated down. In order to propogate down, any entity must be reachable. This works fine for storing, however removed entities are not reachable anymore and the clear has cleared the EM's list of removed entities. Because of this, removed subentities are in fact not removed, but where cleared by the clear call. To work around this, this wrapper was created: 1. keep a separate administration of removed enitit
| Field Summary | |
|---|---|
static java.lang.Object |
CLEARED_ENTITIES
|
static java.lang.String |
SOURCECODE_VERSION
Standard variable for determining version of a class file. |
| Constructor Summary | |
|---|---|
protected |
EntityManagerExtender(javax.persistence.EntityManager em)
|
| Method Summary | |
|---|---|
void |
clearAllRemovedEntities()
|
void |
clearDelayedMerges()
|
void |
clearDelayedPersists()
|
void |
clearRemovedEntities()
|
static void |
executeNextClearWithoutClearingRemovedEntities(javax.persistence.EntityManager entityManager)
|
java.util.List |
getAllRemovedEntities()
AllRemovedEntities: the EM will erase its removed entities upon a "clear" |
java.util.List |
getDelayedMerges()
DelayedMerges |
java.util.List |
getDelayedPersists()
DelayedPersists |
javax.persistence.EntityManager |
getEntityManager()
EntityManager |
java.util.List |
getRemovedEntities()
RemovedEntities: the entities that are also remember by the wrapped EM |
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
|
static javax.persistence.EntityManager |
wrap(javax.persistence.EntityManager em)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SOURCECODE_VERSION
public static final java.lang.Object CLEARED_ENTITIES
| Constructor Detail |
|---|
protected EntityManagerExtender(javax.persistence.EntityManager em)
| Method Detail |
|---|
public javax.persistence.EntityManager getEntityManager()
public java.util.List getAllRemovedEntities()
public void clearAllRemovedEntities()
public java.util.List getRemovedEntities()
public void clearRemovedEntities()
public java.util.List getDelayedMerges()
public void clearDelayedMerges()
public java.util.List getDelayedPersists()
public void clearDelayedPersists()
public java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Throwable
invoke in interface java.lang.reflect.InvocationHandlerjava.lang.Throwablepublic static javax.persistence.EntityManager wrap(javax.persistence.EntityManager em)
public static void executeNextClearWithoutClearingRemovedEntities(javax.persistence.EntityManager entityManager)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||