Module org.eclipse.persistence.jpa
Class EntityListener<T>
java.lang.Object
org.eclipse.persistence.descriptors.DescriptorEventAdapter
org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListener<T>
- All Implemented Interfaces:
EventListener,DescriptorEventListener
- Direct Known Subclasses:
EntityClassListener
An EntityListener 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.
- Since:
- Eclipselink 1.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntityListener(Class<?> entityClass) INTERNAL:EntityListener(Class<T> listenerClass, Class<?> entityClass) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventMethod(String event, Method method) INTERNAL: You can have multiple event methods for the same event, however, only one event method per class is permitted.protected TConstruct an instance of the wrapped entity listener This method will attempt to create the listener in a CDI injection friendly manner and if that fails, reflectively instantiate the classprotected TcreateEntityListenerAndInjectDependencies(Class<T> entityListenerClass) Create the wrapped listener and trigger CDI injection.INTERNAL:Class<?> INTERNAL:getEventMethods(int eventCode) INTERNAL:getEventMethods(String event) INTERNAL:protected MethodgetLastEventMethod(String event) INTERNAL: Assumes a check for event methods for the given event has been called beforehand.Class<?> INTERNAL:INTERNAL:booleanINTERNAL:protected booleanhasEventMethods(int eventCode) INTERNAL:protected booleanhasEventMethods(String event) INTERNAL:protected booleanhasOverriddenEventMethod(Method eventMethod, int eventCode) INTERNAL:protected booleanhasOverriddenEventMethod(Method eventMethod, String eventCode) INTERNAL:protected booleanhasOverriddenEventMethod(List<Method> eventMethods, Method eventMethod) INTERNAL:booleanisOverriddenEvent(DescriptorEvent event, List<DescriptorEventManager> eventManagers) INTERNAL: Return true if listener has a lifecycle callback method that is overridden in a subclass.voidpostBuild(DescriptorEvent event) INTERNAL:voidpostClone(DescriptorEvent event) INTERNAL:voidpostDelete(DescriptorEvent event) INTERNAL:voidpostInsert(DescriptorEvent event) INTERNAL:voidpostRefresh(DescriptorEvent event) INTERNAL:voidpostUpdate(DescriptorEvent event) INTERNAL:voidprePersist(DescriptorEvent event) INTERNAL:voidpreRemove(DescriptorEvent event) INTERNAL:voidINTERNAL:voidsetAllEventMethods(Map<String, List<Method>> methods) INTERNAL:voidsetOwningSession(AbstractSession owningSession) INTERNAL:voidsetPostBuildMethod(Method method) INTERNAL:voidsetPostCloneMethod(Method method) INTERNAL:voidsetPostDeleteMethod(Method method) INTERNAL:voidsetPostInsertMethod(Method method) INTERNAL:voidsetPostRefreshMethod(Method method) INTERNAL:voidsetPostUpdateMethod(Method method) INTERNAL:voidsetPrePersistMethod(Method method) INTERNAL:voidsetPreRemoveMethod(Method method) INTERNAL:voidsetPreUpdateWithChangesMethod(Method method) INTERNAL:toString()INTERNAL: Used in the debugger.protected voidvalidateMethod(Method method) INTERNAL:protected voidvalidateMethodModifiers(Method method) INTERNAL:Methods inherited from class org.eclipse.persistence.descriptors.DescriptorEventAdapter
aboutToDelete, aboutToInsert, aboutToUpdate, postMerge, postWrite, preDelete, preInsert, preUpdate, preWrite
-
Field Details
-
POST_BUILD
- See Also:
-
POST_CLONE
- See Also:
-
POST_DELETE
- See Also:
-
POST_INSERT
- See Also:
-
POST_REFRESH
- See Also:
-
POST_UPDATE
- See Also:
-
PRE_PERSIST
- See Also:
-
PRE_REMOVE
- See Also:
-
PRE_UPDATE_WITH_CHANGES
- See Also:
-
-
Constructor Details
-
EntityListener
INTERNAL: -
EntityListener
-
-
Method Details
-
addEventMethod
INTERNAL: You can have multiple event methods for the same event, however, only one event method per class is permitted. -
createEntityListenerAndInjectDependencies
Create the wrapped listener and trigger CDI injection.- Parameters:
entityListenerClass- theEntityListenerclass- Returns:
- the class instance that has had injection run on it. If injection fails, null.
-
constructListenerInstance
Construct an instance of the wrapped entity listener This method will attempt to create the listener in a CDI injection friendly manner and if that fails, reflectively instantiate the class- Returns:
- the entity listener instance
-
getEntityClass
INTERNAL: -
getAllEventMethods
INTERNAL: -
setAllEventMethods
INTERNAL: -
setOwningSession
INTERNAL: -
getEventMethods
INTERNAL: -
getEventMethods
INTERNAL: -
getLastEventMethod
INTERNAL: Assumes a check for event methods for the given event has been called beforehand. -
getListener
-
getListenerClass
INTERNAL: -
getOwningSession
INTERNAL: -
hasCallbackMethods
public boolean hasCallbackMethods()INTERNAL: -
hasEventMethods
protected boolean hasEventMethods(int eventCode) INTERNAL: -
hasEventMethods
INTERNAL: -
hasOverriddenEventMethod
INTERNAL: -
hasOverriddenEventMethod
INTERNAL: -
hasOverriddenEventMethod
INTERNAL: -
isOverriddenEvent
INTERNAL: Return true if listener has a lifecycle callback method that is overridden in a subclass.- Specified by:
isOverriddenEventin interfaceDescriptorEventListener- Overrides:
isOverriddenEventin classDescriptorEventAdapter
-
postBuild
INTERNAL:- Specified by:
postBuildin interfaceDescriptorEventListener- Overrides:
postBuildin classDescriptorEventAdapter
-
postClone
INTERNAL:- Specified by:
postClonein interfaceDescriptorEventListener- Overrides:
postClonein classDescriptorEventAdapter
-
postDelete
INTERNAL:- Specified by:
postDeletein interfaceDescriptorEventListener- Overrides:
postDeletein classDescriptorEventAdapter
-
postInsert
INTERNAL:- Specified by:
postInsertin interfaceDescriptorEventListener- Overrides:
postInsertin classDescriptorEventAdapter
-
postRefresh
INTERNAL:- Specified by:
postRefreshin interfaceDescriptorEventListener- Overrides:
postRefreshin classDescriptorEventAdapter
-
postUpdate
INTERNAL:- Specified by:
postUpdatein interfaceDescriptorEventListener- Overrides:
postUpdatein classDescriptorEventAdapter
-
prePersist
INTERNAL:- Specified by:
prePersistin interfaceDescriptorEventListener- Overrides:
prePersistin classDescriptorEventAdapter
-
preRemove
INTERNAL:- Specified by:
preRemovein interfaceDescriptorEventListener- Overrides:
preRemovein classDescriptorEventAdapter
-
preUpdateWithChanges
INTERNAL:- Specified by:
preUpdateWithChangesin interfaceDescriptorEventListener- Overrides:
preUpdateWithChangesin classDescriptorEventAdapter
-
setPostBuildMethod
INTERNAL: -
setPostCloneMethod
INTERNAL: -
setPostDeleteMethod
INTERNAL: -
setPostInsertMethod
INTERNAL: -
setPostRefreshMethod
INTERNAL: -
setPostUpdateMethod
INTERNAL: -
setPrePersistMethod
INTERNAL: -
setPreRemoveMethod
INTERNAL: -
setPreUpdateWithChangesMethod
INTERNAL: -
toString
INTERNAL: Used in the debugger. -
validateMethod
INTERNAL: -
validateMethodModifiers
INTERNAL:
-