java.lang.Object
org.eclipse.persistence.internal.jpa.metadata.ORMetadata
org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListenerMetadata
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
EntityClassListenerMetadata

public class EntityListenerMetadata extends ORMetadata implements Cloneable
A MetadataEntityListener and is placed on the owning entity's descriptor. Callback methods from an EntityListener require a signature on the method. Namely, they must have an Object parameter. Key notes: - any metadata mapped from XML to this class must be compared in the equals method. - when loading from annotations, the constructor accepts the metadata accessor this metadata was loaded from. Used it to look up any 'companion' annotation needed for processing. - methods should be preserved in alphabetical order.
Since:
TopLink 10.1.3/EJB 3.0 Preview
  • Field Details

  • Constructor Details

    • EntityListenerMetadata

      public EntityListenerMetadata()
      INTERNAL: Used for XML loading.
    • EntityListenerMetadata

      public EntityListenerMetadata(MetadataAnnotation entityListeners, MetadataClass entityListenerClass, MetadataAccessor accessor)
      INTERNAL: Used for annotation loading.
  • Method Details

    • clone

      public Object clone()
      INTERNAL: This method should be called when dealing with default listeners.
      Overrides:
      clone in class Object
    • equals

      public boolean equals(Object objectToCompare)
      INTERNAL:
      Specified by:
      equals in class ORMetadata
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getCallbackMethod

      protected Method getCallbackMethod(String methodName, Method[] methods)
      INTERNAL: Find the method in the list where method.getName() == methodName.
    • getClassName

      public String getClassName()
      INTERNAL: Used for OX mapping.
    • getIdentifier

      public String getIdentifier()
      INTERNAL:
      Overrides:
      getIdentifier in class ORMetadata
      See Also:
    • getInstance

      protected Object getInstance(Class<?> cls)
      INTERNAL:
    • getPostLoad

      public String getPostLoad()
      INTERNAL: Used for OX mapping.
    • getPostPersist

      public String getPostPersist()
      INTERNAL: Used for OX mapping.
    • getPostRemove

      public String getPostRemove()
      INTERNAL: Used for OX mapping.
    • getPostUpdate

      public String getPostUpdate()
      INTERNAL: Used for OX mapping
    • getPrePersist

      public String getPrePersist()
      INTERNAL: Used for OX mapping.
    • getPreRemove

      public String getPreRemove()
      INTERNAL: Used for OX mapping.
    • getPreUpdate

      public String getPreUpdate()
      INTERNAL: Used for OX mapping.
    • initXMLObject

      public void initXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings)
      INTERNAL:
      Overrides:
      initXMLObject in class ORMetadata
    • process

      public void process(ClassAccessor classAccessor, ClassLoader loader, boolean isDefaultListener)
      INTERNAL:
    • processCallbackMethods

      protected void processCallbackMethods(Method[] methods, ClassAccessor classAccessor)
      INTERNAL: Process the the callback methods. The XML defined callback methods are always added first, followed by those defined by annotations (only if not already defined in XML)
    • setClassName

      public void setClassName(String className)
      INTERNAL: Used for OX mapping.
    • setPostLoad

      protected void setPostLoad(Method method)
      INTERNAL: Set the post load event method on the listener.
    • setPostLoad

      public void setPostLoad(String postLoad)
      INTERNAL: Used for OX mapping.
    • setPostPersist

      protected void setPostPersist(Method method)
      INTERNAL: Set the post persist event method on the listener.
    • setPostPersist

      public void setPostPersist(String postPersist)
      INTERNAL: Used for OX mapping.
    • setPostRemove

      protected void setPostRemove(Method method)
      INTERNAL: Set the post remove event method on the listener.
    • setPostRemove

      public void setPostRemove(String postRemove)
      INTERNAL: Used for OX mapping.
    • setPostUpdate

      protected void setPostUpdate(Method method)
      INTERNAL: * Set the post update event method on the listener.
    • setPostUpdate

      public void setPostUpdate(String postUpdate)
      INTERNAL: Used for OX mapping.
    • setPrePersist

      protected void setPrePersist(Method method)
      INTERNAL: Set the pre persist event method on the listener.
    • setPrePersist

      public void setPrePersist(String prePersist)
      INTERNAL: Used for OX mapping
    • setPreRemove

      protected void setPreRemove(Method method)
      INTERNAL: Set the pre remove event method on the listener.
    • setPreRemove

      public void setPreRemove(String preRemove)
      INTERNAL: Used for OX mapping.
    • setPreUpdate

      protected void setPreUpdate(Method method)
      INTERNAL: Set the pre update event method on the listener.
    • setPreUpdate

      public void setPreUpdate(String preUpdate)
      INTERNAL: Used for OX mapping.