|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.gps.device.jpa.lifecycle.HibernateJpaEntityLifecycleInjector
public class HibernateJpaEntityLifecycleInjector
Injects lifecycle listeners directly into Hibernate for mirroring operations.
By default, registers with plain insert/update/delete listeners, which will be triggered
by Hibernate before committing (and up to Hibernate flushing logic). Also allows to be created
with setting the registerPostCommitListeneres to true which will cause
the insert/update/delete listeneres to be registered as post commit events.
| Nested Class Summary | |
|---|---|
static class |
HibernateJpaEntityLifecycleInjector.HibernateEventListener
|
| Field Summary | |
|---|---|
protected boolean |
registerPostCommitListeneres
|
| Constructor Summary | |
|---|---|
HibernateJpaEntityLifecycleInjector()
|
|
HibernateJpaEntityLifecycleInjector(boolean registerPostCommitListeneres)
Creates a new lifecycle injector. |
|
| Method Summary | |
|---|---|
protected Object |
doCreateListener(JpaGpsDevice device)
|
void |
injectLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory,
JpaGpsDevice device)
Injects a global lifecycle listener into the concrete EntityManagerFactory |
void |
removeLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory,
JpaGpsDevice device)
Removes (if possible) lifecycle listeners injected using the inject method. |
boolean |
requireRefresh()
Does this injector requires refreshing (i.e. remove and inject) of new listeners upon CompassGpsDevice.refresh(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final boolean registerPostCommitListeneres
| Constructor Detail |
|---|
public HibernateJpaEntityLifecycleInjector()
public HibernateJpaEntityLifecycleInjector(boolean registerPostCommitListeneres)
true)
or with plain post events (triggered based on Hibrenate flushing logic).
registerPostCommitListeneres - true if post commit listeners will be
registered. false for plain listeners.| Method Detail |
|---|
public boolean requireRefresh()
JpaEntityLifecycleInjectorCompassGpsDevice.refresh().
requireRefresh in interface JpaEntityLifecycleInjector
public void injectLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory,
JpaGpsDevice device)
throws JpaGpsDeviceException
JpaEntityLifecycleInjectorEntityManagerFactory
implementation.
- Specified by:
injectLifecycle in interface JpaEntityLifecycleInjector
- Parameters:
entityManagerFactory - The EntityManagerFactory to inject the global lifecycle to.device - The Jpa device calling this injector
- Throws:
JpaGpsDeviceException
public void removeLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory,
JpaGpsDevice device)
throws JpaGpsDeviceException
JpaEntityLifecycleInjector
removeLifecycle in interface JpaEntityLifecycleInjectorentityManagerFactory - The EMF to remove lifecycle fromdevice - The Jpa device calling
JpaGpsDeviceExceptionprotected Object doCreateListener(JpaGpsDevice device)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||