Interface Callback

All Superinterfaces:
Serializable
All Known Implementing Classes:
EmbeddableCallback, EntityCallback, ListenerCallback

public interface Callback extends Serializable
Represents a JPA entity lifecycle callback method.

There are two flavors of this, which we abstract here:

  • an annotated method of the entity class itself, or
  • an annotated method of a separate entity listener class identified via the EntityListeners annotation.
  • Method Summary

    Modifier and Type
    Method
    Description
    The type of callback (pre-update, pre-persist, etc) handled
    void
    Contract for performing the callback
  • Method Details

    • getCallbackType

      CallbackType getCallbackType()
      The type of callback (pre-update, pre-persist, etc) handled
    • performCallback

      void performCallback(Object entity)
      Contract for performing the callback
      Parameters:
      entity - Reference to the entity for which the callback is triggered.