Interface PersistentEventHandler<P extends Persistent>

All Known Implementing Classes:
ObjectExtensionCleaner, PersistentEventAdapter

public interface PersistentEventHandler<P extends Persistent>
This interface provides a hook for some action when an object is inserted, updated or deleted. The methods beforeInsert, beforeUpdate, and beforeDelete are called before the database operation is executed but after the corresponding method of Persistent has been called. The methods afterInsert, afterUpdate, afterDelete and afterRead are called after both the database operation and the corresponding method of Persistent have been executed. Register your event handler using StoreUtil.addEventHandler(PersistentEventHandler, Class[])
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called after the object has been deleted from the database.
    default void
    Called after the object has been inserted into the database.
    default void
    Called after the object is read from database.
    default void
    Called after the object has been updated in the database.
    default void
    Called before the object is deleted from the database.
    default void
    Called before the object is inserted into the database.
    default void
    Called before the object is updated in the database.
  • Method Details

    • beforeInsert

      default void beforeInsert(P o)
      Called before the object is inserted into the database.
      Parameters:
      o - the object to be inserted
    • beforeUpdate

      default void beforeUpdate(P o)
      Called before the object is updated in the database.
      Parameters:
      o - the object to be updated
    • beforeDelete

      default void beforeDelete(P o)
      Called before the object is deleted from the database.
      Parameters:
      o - the object to be deleted
    • afterInsert

      default void afterInsert(P o)
      Called after the object has been inserted into the database.
      Parameters:
      o - the inserted object
    • afterUpdate

      default void afterUpdate(P o)
      Called after the object has been updated in the database.
      Parameters:
      o - the updated object
    • afterDelete

      default void afterDelete(P o)
      Called after the object has been deleted from the database.
      Parameters:
      o - the deleted object
    • afterRead

      default void afterRead(P o)
      Called after the object is read from database.
      Parameters:
      o - the object, which has been read