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 ch.tocco.nice2.persist.core.api.util.CollectingAfterFlushEntityListener
CollectingAfterFlushEntityListener.EntityContext
-
Constructor Summary
ConstructorDescriptionSetChildrenFlagListener
(ContentTreeService contentTreeService, SecurityManager securityManager) -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected void
int
priority()
Defines execution order of allCollectingAfterFlushEntityListener
.Methods inherited from class ch.tocco.nice2.persist.core.api.util.CollectingAfterFlushEntityListener
afterCommit, afterFlush, beforeCommit, entityChanging, entityCreating, entityDeleting, entityRelationChanging, getEntityContext, onEntityChanging, onEntityCreating, onEntityDeleting
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.entity.events.EntityFacadeListener
entityReceivedValues, handleSessionOnlyEntity
-
Constructor Details
-
SetChildrenFlagListener
public SetChildrenFlagListener(ContentTreeService contentTreeService, SecurityManager securityManager)
-
-
Method Details
-
onAfterFlush
- Specified by:
onAfterFlush
in classCollectingAfterFlushEntityListener
- Returns:
- true if this listeners has made any changes to the database
-
onEntityRelationChanging
- Overrides:
onEntityRelationChanging
in classCollectingAfterFlushEntityListener
-
priority
public int priority()Description copied from class:CollectingAfterFlushEntityListener
Defines execution order of allCollectingAfterFlushEntityListener
. It is important to make sure that other listeners are not affected.- Specified by:
priority
in interfaceCommitListener
- Specified by:
priority
in classCollectingAfterFlushEntityListener
-
createEntityContext
- Overrides:
createEntityContext
in classCollectingAfterFlushEntityListener
-