Class SaveEventListener

  • All Implemented Interfaces:
    java.io.Serializable, org.hibernate.event.SaveOrUpdateEventListener

    public class SaveEventListener
    extends org.hibernate.event.def.DefaultSaveEventListener
    event listener which will only handle newly created (transient) objects in a given graph. It will ignore unloaded and detached objects by default. This is primarily a performance optimization.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SAVE_EVENT  
      • Fields inherited from class org.hibernate.event.def.AbstractSaveEventListener

        DELETED, DETACHED, PERSISTENT, TRANSIENT
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onSaveOrUpdate​(org.hibernate.event.SaveOrUpdateEvent event)  
      • Methods inherited from class org.hibernate.event.def.DefaultSaveEventListener

        performSaveOrUpdate, reassociateIfUninitializedProxy, saveWithGeneratedOrRequestedId
      • Methods inherited from class org.hibernate.event.def.DefaultSaveOrUpdateEventListener

        entityIsDetached, entityIsPersistent, entityIsTransient, getCascadeAction, getUpdateId, invokeUpdateLifecycle, performUpdate
      • Methods inherited from class org.hibernate.event.def.AbstractSaveEventListener

        cascadeAfterSave, cascadeBeforeSave, getAssumedUnsaved, getEntityState, getLoggableName, getMergeMap, invokeSaveLifecycle, isVersionIncrementDisabled, performSave, performSaveOrReplicate, saveWithGeneratedId, saveWithRequestedId, substituteValuesIfNecessary, validate, visitCollectionsBeforeSave
      • Methods inherited from class org.hibernate.event.def.AbstractReassociateEventListener

        reassociate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SaveEventListener

        public SaveEventListener​(CurrentDetails cd,
                                 TokenHolder th)
        main constructor. Requires a non-null security system
    • Method Detail

      • onSaveOrUpdate

        public void onSaveOrUpdate​(org.hibernate.event.SaveOrUpdateEvent event)
                            throws org.hibernate.HibernateException
        Specified by:
        onSaveOrUpdate in interface org.hibernate.event.SaveOrUpdateEventListener
        Overrides:
        onSaveOrUpdate in class org.hibernate.event.def.DefaultSaveOrUpdateEventListener
        Throws:
        org.hibernate.HibernateException