|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.gps.device.hibernate.lifecycle.DefaultHibernateEntityLifecycleInjector
public class DefaultHibernateEntityLifecycleInjector
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.
| Field Summary | |
|---|---|
protected boolean |
marshallIds
|
protected boolean |
pendingCascades
|
protected boolean |
processCollection
|
protected boolean |
registerPostCommitListeneres
|
| Constructor Summary | |
|---|---|
DefaultHibernateEntityLifecycleInjector()
|
|
DefaultHibernateEntityLifecycleInjector(boolean registerPostCommitListeneres)
Creates a new lifecycle injector. |
|
| Method Summary | |
|---|---|
protected Object |
doCreateListener(HibernateGpsDevice device)
|
void |
injectLifecycle(SessionFactory sessionFactory,
HibernateGpsDevice device)
Injects a global lifecycle listener into the concrete SessionFactory |
void |
removeLifecycle(SessionFactory sessionFactory,
HibernateGpsDevice device)
Removes (if possible) lifecycle listeners injected using the inject method. |
void |
setMarshallIds(boolean marshallIds)
Should the listener try and marshall ids for the event listener of post insert. |
void |
setPendingCascades(boolean pendingCascades)
Should the listener try and handle pending cascades avoiding trying to save/update relationships in Compass before they were processed by Hibernate. |
void |
setProcessCollection(boolean processCollection)
Should the event listener automatically set the processed flag on collections that are created as a result of the marshalling process of Compass. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean registerPostCommitListeneres
protected boolean marshallIds
protected boolean pendingCascades
protected boolean processCollection
| Constructor Detail |
|---|
public DefaultHibernateEntityLifecycleInjector()
public DefaultHibernateEntityLifecycleInjector(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 void setMarshallIds(boolean marshallIds)
false.
public void setPendingCascades(boolean pendingCascades)
true.
Note, if set, might cause Compass event processing to be a *tad* slower.
public void setProcessCollection(boolean processCollection)
true.
public void injectLifecycle(SessionFactory sessionFactory,
HibernateGpsDevice device)
throws HibernateGpsDeviceException
HibernateEntityLifecycleInjectorSessionFactory
implementation.
- Specified by:
injectLifecycle in interface HibernateEntityLifecycleInjector
- Parameters:
sessionFactory - The SessionFactory to inject the global lifecycle to.device - The Jpa device calling this injector
- Throws:
HibernateGpsDeviceException
public void removeLifecycle(SessionFactory sessionFactory,
HibernateGpsDevice device)
throws HibernateGpsDeviceException
HibernateEntityLifecycleInjector
removeLifecycle in interface HibernateEntityLifecycleInjectorsessionFactory - The SessionFactory to remove lifecycle fromdevice - The Jpa device calling
HibernateGpsDeviceExceptionprotected Object doCreateListener(HibernateGpsDevice device)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||