Class SetChildrenFlagListener
java.lang.Object
ch.tocco.nice2.persist.core.api.util.CollectingAfterFlushEntityListener
ch.tocco.nice2.dms.impl.entitylistener.SetChildrenFlagListener
- All Implemented Interfaces:
EntityFacadeListener, CommitListener, EventListener
Sets a boolean flag "has_children" on container nodes. This results in better performance for leafs since a resolve
for children is not necessary if we know that it does not have any children anyways.
-
Nested Class Summary
Nested classes/interfaces inherited from class CollectingAfterFlushEntityListener
CollectingAfterFlushEntityListener.EntityContext -
Constructor Summary
ConstructorsConstructorDescriptionSetChildrenFlagListener(ContentTreeService contentTreeService, SecurityManager securityManager) -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected voidintpriority()Defines execution order of allCollectingAfterFlushEntityListener.Methods inherited from class CollectingAfterFlushEntityListener
afterCommit, afterFlush, beforeCommit, entityChanging, entityCreating, entityDeleting, entityRelationChanging, getEntityContext, onEntityChanging, onEntityCreating, onEntityDeletingMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EntityFacadeListener
entityReceivedValues, handleSessionOnlyEntity
-
Constructor Details
-
SetChildrenFlagListener
public SetChildrenFlagListener(ContentTreeService contentTreeService, SecurityManager securityManager)
-
-
Method Details
-
onAfterFlush
- Specified by:
onAfterFlushin classCollectingAfterFlushEntityListener- Returns:
- true if this listeners has made any changes to the database
-
onEntityRelationChanging
- Overrides:
onEntityRelationChangingin classCollectingAfterFlushEntityListener
-
priority
public int priority()Description copied from class:CollectingAfterFlushEntityListenerDefines execution order of allCollectingAfterFlushEntityListener. It is important to make sure that other listeners are not affected.- Specified by:
priorityin interfaceCommitListener- Specified by:
priorityin classCollectingAfterFlushEntityListener
-
createEntityContext
- Overrides:
createEntityContextin classCollectingAfterFlushEntityListener
-