Class EntityListenerMetadata

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    EntityClassListenerMetadata

    public class EntityListenerMetadata
    extends ORMetadata
    implements java.lang.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
    Author:
    Guy Pelletier
    • Constructor Detail

      • EntityListenerMetadata

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

      • clone

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

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

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

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

        public java.lang.String getClassName()
        INTERNAL: Used for OX mapping.
      • getInstance

        protected java.lang.Object getInstance​(java.lang.Class cls)
        INTERNAL:
      • getPostLoad

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

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

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

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

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

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

        public java.lang.String getPreUpdate()
        INTERNAL: Used for OX mapping.
      • process

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

        protected void processCallbackMethods​(java.lang.reflect.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​(java.lang.String className)
        INTERNAL: Used for OX mapping.
      • setPostLoad

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

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

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

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

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

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

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

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

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

        public void setPrePersist​(java.lang.String prePersist)
        INTERNAL: Used for OX mapping
      • setPreRemove

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

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

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

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