Module org.eclipse.persistence.jpa
Class EntityListenerMetadata
- 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
- Author:
- Guy Pelletier
-
-
Field Summary
Fields Modifier and Type Field Description protected EntityListenerm_listener-
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
m_project
-
-
Constructor Summary
Constructors Constructor Description EntityListenerMetadata()INTERNAL: Used for XML loading.EntityListenerMetadata(MetadataAnnotation entityListeners, MetadataClass entityListenerClass, MetadataAccessor accessor)INTERNAL: Used for annotation loading.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()INTERNAL: This method should be called when dealing with default listeners.booleanequals(Object objectToCompare)INTERNAL:protected MethodgetCallbackMethod(String methodName, Method[] methods)INTERNAL: Find the method in the list where method.getName() == methodName.StringgetClassName()INTERNAL: Used for OX mapping.StringgetIdentifier()INTERNAL:protected ObjectgetInstance(Class<?> cls)INTERNAL:StringgetPostLoad()INTERNAL: Used for OX mapping.StringgetPostPersist()INTERNAL: Used for OX mapping.StringgetPostRemove()INTERNAL: Used for OX mapping.StringgetPostUpdate()INTERNAL: Used for OX mappingStringgetPrePersist()INTERNAL: Used for OX mapping.StringgetPreRemove()INTERNAL: Used for OX mapping.StringgetPreUpdate()INTERNAL: Used for OX mapping.inthashCode()voidinitXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings)INTERNAL:voidprocess(ClassAccessor classAccessor, ClassLoader loader, boolean isDefaultListener)INTERNAL:protected voidprocessCallbackMethods(Method[] methods, ClassAccessor classAccessor)INTERNAL: Process the the callback methods.voidsetClassName(String className)INTERNAL: Used for OX mapping.protected voidsetPostLoad(Method method)INTERNAL: Set the post load event method on the listener.voidsetPostLoad(String postLoad)INTERNAL: Used for OX mapping.protected voidsetPostPersist(Method method)INTERNAL: Set the post persist event method on the listener.voidsetPostPersist(String postPersist)INTERNAL: Used for OX mapping.protected voidsetPostRemove(Method method)INTERNAL: Set the post remove event method on the listener.voidsetPostRemove(String postRemove)INTERNAL: Used for OX mapping.protected voidsetPostUpdate(Method method)INTERNAL: * Set the post update event method on the listener.voidsetPostUpdate(String postUpdate)INTERNAL: Used for OX mapping.protected voidsetPrePersist(Method method)INTERNAL: Set the pre persist event method on the listener.voidsetPrePersist(String prePersist)INTERNAL: Used for OX mappingprotected voidsetPreRemove(Method method)INTERNAL: Set the pre remove event method on the listener.voidsetPreRemove(String preRemove)INTERNAL: Used for OX mapping.protected voidsetPreUpdate(Method method)INTERNAL: Set the pre update event method on the listener.voidsetPreUpdate(String preUpdate)INTERNAL: Used for OX mapping.-
Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
getAccessibleObject, getAccessibleObjectName, getAnnotation, getBoxedType, getDatabaseTypeEnum, getEntityMappings, getFullyQualifiedClassName, getJavaClass, getJavaClassName, getLoader, getLocation, getLogger, getMetadataClass, getMetadataClass, getMetadataClass, getMetadataFactory, getName, getPrimitiveClassForName, getProject, getText, getXMLElement, hasIdentifier, hasText, initXMLClassName, initXMLObject, initXMLObjects, initXMLTextObject, loadedFromAnnotation, loadedFromEclipseLinkXML, loadedFromXML, merge, mergeORObjectLists, mergeORObjects, mergeSimpleObjects, reloadEntity, reloadMappedSuperclass, setAccessibleObject, setEntityMappings, setFieldName, setFieldName, setProject, shouldOverride, valuesMatch, valuesMatch
-
-
-
-
Field Detail
-
m_listener
protected EntityListener m_listener
-
-
Constructor Detail
-
EntityListenerMetadata
public EntityListenerMetadata()
INTERNAL: Used for XML loading.
-
EntityListenerMetadata
public EntityListenerMetadata(MetadataAnnotation entityListeners, MetadataClass entityListenerClass, MetadataAccessor accessor)
INTERNAL: Used for annotation loading.
-
-
Method Detail
-
clone
public Object clone()
INTERNAL: This method should be called when dealing with default listeners.
-
equals
public boolean equals(Object objectToCompare)
INTERNAL:- Specified by:
equalsin classORMetadata
-
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:
-
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:
initXMLObjectin classORMetadata
-
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.
-
-