Class LifecycleEventHandler

java.lang.Object
org.hibernate.boot.models.spi.LifecycleEventHandler

public class LifecycleEventHandler extends Object
Models a JPA-style lifecycle event handler, whether callback or listener style. It tracks event callback methods for a specific listener class, which may be the entity class or mapped-superclass class in the case of callback style.
See Also:
  • Constructor Details

    • LifecycleEventHandler

      public LifecycleEventHandler(JpaEventListenerStyle consumerType, org.hibernate.models.spi.ClassDetails listenerClass, Map<CallbackType, org.hibernate.models.spi.MethodDetails> callbackMethods)
  • Method Details

    • getStyle

      public JpaEventListenerStyle getStyle()
    • getCallbackClass

      public org.hibernate.models.spi.ClassDetails getCallbackClass()
    • getCallbackMethod

      public org.hibernate.models.spi.MethodDetails getCallbackMethod(CallbackType callbackType)
    • getPrePersistMethod

      public org.hibernate.models.spi.MethodDetails getPrePersistMethod()
    • getPostPersistMethod

      public org.hibernate.models.spi.MethodDetails getPostPersistMethod()
    • getPreRemoveMethod

      public org.hibernate.models.spi.MethodDetails getPreRemoveMethod()
    • getPostRemoveMethod

      public org.hibernate.models.spi.MethodDetails getPostRemoveMethod()
    • getPreUpdateMethod

      public org.hibernate.models.spi.MethodDetails getPreUpdateMethod()
    • getPostUpdateMethod

      public org.hibernate.models.spi.MethodDetails getPostUpdateMethod()
    • getPostLoadMethod

      public org.hibernate.models.spi.MethodDetails getPostLoadMethod()
    • hasCallbackMethods

      public boolean hasCallbackMethods()
    • from

      public static LifecycleEventHandler from(JpaEventListenerStyle consumerType, org.hibernate.models.spi.ClassDetails listenerClassDetails, org.hibernate.boot.jaxb.mapping.spi.JaxbEntityListenerImpl jaxbMapping, org.hibernate.models.spi.ModelsContext modelsContext)
      Create a handler from XML representation of a callback or listener.
    • from

      public static LifecycleEventHandler from(JpaEventListenerStyle consumerType, org.hibernate.models.spi.ClassDetails listenerClassDetails, boolean errorIfEmpty)
      Create a handler from annotations based on annotated methods on the given listenerClassDetails.
    • listenersForTarget

      public static List<LifecycleEventHandler> listenersForTarget(org.hibernate.models.spi.ClassDetails listenerClassDetails, org.hibernate.models.spi.ClassDetails targetClassDetails, boolean errorIfEmpty)
      Create a listener handler from annotations, selecting only methods applicable to the callback target type.
    • matchesSignature

      public static boolean matchesSignature(JpaEventListenerStyle callbackType, org.hibernate.models.spi.MethodDetails methodDetails)