Class ReferenceCodeCreateEntityListener
java.lang.Object
ch.tocco.nice2.persist.core.api.util.CollectingAfterFlushEntityListener<CollectingAfterFlushEntityListener.EntityContext>
ch.tocco.nice2.optional.finance.impl.entitylistener.ReferenceCodeCreateEntityListener
- All Implemented Interfaces:
EntityFacadeListener, CommitListener, EventListener
@Component
public class ReferenceCodeCreateEntityListener
extends CollectingAfterFlushEntityListener<CollectingAfterFlushEntityListener.EntityContext>
generates a reference code for an order, when it is created
uses
ReferenceCodeService
CollectingAfterCommitListener because it needs the order number, which is generated on flush-
Nested Class Summary
Nested classes/interfaces inherited from class CollectingAfterFlushEntityListener
CollectingAfterFlushEntityListener.EntityContext -
Constructor Summary
ConstructorsConstructorDescriptionReferenceCodeCreateEntityListener(ReferenceCodeService referenceCodeService, SecurityManager securityManager) -
Method Summary
Modifier and TypeMethodDescriptionbooleanintpriority()Defines execution order of allCollectingAfterFlushEntityListener.Methods inherited from class CollectingAfterFlushEntityListener
afterCommit, afterFlush, beforeCommit, createEntityContext, entityChanging, entityCreating, entityDeleting, entityRelationChanging, getEntityContext, onEntityChanging, onEntityCreating, onEntityDeleting, onEntityRelationChangingMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EntityFacadeListener
entityReceivedValues, handleSessionOnlyEntity
-
Constructor Details
-
ReferenceCodeCreateEntityListener
public ReferenceCodeCreateEntityListener(ReferenceCodeService referenceCodeService, SecurityManager securityManager)
-
-
Method Details
-
onAfterFlush
- Specified by:
onAfterFlushin classCollectingAfterFlushEntityListener<CollectingAfterFlushEntityListener.EntityContext>- Returns:
- true if this listeners has made any changes to the database
-
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<CollectingAfterFlushEntityListener.EntityContext>
-