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
-
Constructor Summary
ModifierConstructorDescriptionprotected
EntityListener
(Class<?> entityClass) INTERNAL:EntityListener
(Class<T> listenerClass, Class<?> entityClass) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEventMethod
(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 T
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 classprotected T
createEntityListenerAndInjectDependencies
(Class<T> entityListenerClass) Create the wrapped listener and trigger CDI injection.INTERNAL:Class
<?> INTERNAL:getEventMethods
(int eventCode) INTERNAL:getEventMethods
(String event) INTERNAL:protected Method
getLastEventMethod
(String event) INTERNAL: Assumes a check for event methods for the given event has been called beforehand.Class
<?> INTERNAL:INTERNAL:boolean
INTERNAL:protected boolean
hasEventMethods
(int eventCode) INTERNAL:protected boolean
hasEventMethods
(String event) INTERNAL:protected boolean
hasOverriddenEventMethod
(Method eventMethod, int eventCode) INTERNAL:protected boolean
hasOverriddenEventMethod
(Method eventMethod, String eventCode) INTERNAL:protected boolean
hasOverriddenEventMethod
(List<Method> eventMethods, Method eventMethod) INTERNAL:boolean
isOverriddenEvent
(DescriptorEvent event, List<DescriptorEventManager> eventManagers) INTERNAL: Return true if listener has a lifecycle callback method that is overridden in a subclass.void
postBuild
(DescriptorEvent event) INTERNAL:void
postClone
(DescriptorEvent event) INTERNAL:void
postDelete
(DescriptorEvent event) INTERNAL:void
postInsert
(DescriptorEvent event) INTERNAL:void
postRefresh
(DescriptorEvent event) INTERNAL:void
postUpdate
(DescriptorEvent event) INTERNAL:void
prePersist
(DescriptorEvent event) INTERNAL:void
preRemove
(DescriptorEvent event) INTERNAL:void
INTERNAL:void
setAllEventMethods
(Map<String, List<Method>> methods) INTERNAL:void
setOwningSession
(AbstractSession owningSession) INTERNAL:void
setPostBuildMethod
(Method method) INTERNAL:void
setPostCloneMethod
(Method method) INTERNAL:void
setPostDeleteMethod
(Method method) INTERNAL:void
setPostInsertMethod
(Method method) INTERNAL:void
setPostRefreshMethod
(Method method) INTERNAL:void
setPostUpdateMethod
(Method method) INTERNAL:void
setPrePersistMethod
(Method method) INTERNAL:void
setPreRemoveMethod
(Method method) INTERNAL:void
setPreUpdateWithChangesMethod
(Method method) INTERNAL:toString()
INTERNAL: Used in the debugger.protected void
validateMethod
(Method method) INTERNAL:protected void
validateMethodModifiers
(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
- theEntityListener
class- 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:
isOverriddenEvent
in interfaceDescriptorEventListener
- Overrides:
isOverriddenEvent
in classDescriptorEventAdapter
-
postBuild
INTERNAL:- Specified by:
postBuild
in interfaceDescriptorEventListener
- Overrides:
postBuild
in classDescriptorEventAdapter
-
postClone
INTERNAL:- Specified by:
postClone
in interfaceDescriptorEventListener
- Overrides:
postClone
in classDescriptorEventAdapter
-
postDelete
INTERNAL:- Specified by:
postDelete
in interfaceDescriptorEventListener
- Overrides:
postDelete
in classDescriptorEventAdapter
-
postInsert
INTERNAL:- Specified by:
postInsert
in interfaceDescriptorEventListener
- Overrides:
postInsert
in classDescriptorEventAdapter
-
postRefresh
INTERNAL:- Specified by:
postRefresh
in interfaceDescriptorEventListener
- Overrides:
postRefresh
in classDescriptorEventAdapter
-
postUpdate
INTERNAL:- Specified by:
postUpdate
in interfaceDescriptorEventListener
- Overrides:
postUpdate
in classDescriptorEventAdapter
-
prePersist
INTERNAL:- Specified by:
prePersist
in interfaceDescriptorEventListener
- Overrides:
prePersist
in classDescriptorEventAdapter
-
preRemove
INTERNAL:- Specified by:
preRemove
in interfaceDescriptorEventListener
- Overrides:
preRemove
in classDescriptorEventAdapter
-
preUpdateWithChanges
INTERNAL:- Specified by:
preUpdateWithChanges
in interfaceDescriptorEventListener
- Overrides:
preUpdateWithChanges
in 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:
-