Top Description Fields Constructors Methods
org.eclipse.persistence.descriptors

public Class DescriptorEvent

extends EventObject
implements CoreDescriptorEvent
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.core.descriptors.CoreDescriptorEvent
Imports
java.util.*, org.eclipse.persistence.mappings.DatabaseMapping, .DatabaseMapping.WriteType, org.eclipse.persistence.core.descriptors.CoreDescriptorEvent, org.eclipse.persistence.exceptions.ValidationException, .DescriptorException, org.eclipse.persistence.queries.*, org.eclipse.persistence.sessions.DataRecord, org.eclipse.persistence.internal.sessions.*

Purpose: Encapsulate the information provided with descriptor events. This is used as the argument to any event raised by the descriptor. Events can be registered for through two methods, the first is by providing a method to be called on the object that a particular operation is being performed on. The second is by registering a manager object to be notified when any event occurs for that descriptor. The second method is more similar to the java beans event model but requires the registered object to implement the DescriptorEventListener interface.

See Also
DescriptorEventManager, DescriptorEventListener

Field Summary

Modifier and TypeField and Description
protected ObjectChangeSet
changeSet

For the post merge event it is possible that there has been a change set generated.

protected DataRecord
dataRecord

Optionally a database row may be provided on some events, (such as aboutToUpdate).

protected ClassDescriptor
protected int
eventCode

The code of the descriptor event being raised.

protected static String[]
eventNames

Event names for toString()

protected Object
originalObject

The source object represents the object the event is being raised on, some events also require a second object, for example the original object in a postClone.

protected DatabaseQuery
query

The query causing the event.

protected AbstractSession
session

The session in which the event is raised.

Inherited from java.util.EventObject:
source

Constructor Summary

AccessConstructor and Description
public
DescriptorEvent(int eventCode, ObjectLevelModifyQuery query)

PUBLIC: Most events are trigger from queries, so this is a helper method.

public
DescriptorEvent(Object sourceObject)

PUBLIC: All events require a source object.

Method Summary

Modifier and TypeMethod and Description
public void
applyAttributeValuesIntoRow(String attributeName)

PUBLIC: Re-populate the database row with the values from the source object based upon the attribute's mapping.

public ObjectChangeSet
getChangeSet()

PUBLIC: Returns the Object changeSet if available

public ClassDescriptor
getClassDescriptor()

PUBLIC: The source descriptor of the event.

public ClassDescriptor
getDescriptor()

PUBLIC: The source descriptor of the event.

public int
getEventCode()

PUBLIC: The code of the descriptor event being raised.

public Object
getObject()

PUBLIC: Synanym for source.

public Object
getOriginalObject()

PUBLIC: The source object represents the object the event is being raised on, some events also require a second object, for example the original object in a postClone.

public DatabaseQuery
getQuery()

PUBLIC: The query causing the event.

public DataRecord
getRecord()

PUBLIC: Return the record that is associated with some events, such as postBuild, and aboutToUpdate.

public AbstractSession
getSession()

PUBLIC: The session in which the event is raised.

public void
setChangeSet(ObjectChangeSet newChangeSet)

INTERNAL: Sets the Change set in the event if the change Set is available

public void
setDescriptor(ClassDescriptor descriptor)

INTERNAL: The source descriptor of the event.

public void
setEventCode(int eventCode)

INTERNAL: The code of the descriptor event being raised.

public void
setOriginalObject(Object originalObject)

INTERNAL: The source object represents the object the event is being raised on, some events also require a second object, for example the original object in a postClone.

public void
setQuery(DatabaseQuery query)

INTERNAL: The query causing the event.

public void
setRecord(DataRecord dataRecord)

INTERNAL: Optionally a database row may be provided on some events, (such as aboutToUpdate).

public void
setSession(AbstractSession session)

INTERNAL: The session in which the event is raised.

public String
public void
updateAttributeAddObjectToCollection(String attributeName, Object mapKey, Object value)

ADVANCED: Use this method when updating object attribute values, with unmapped objects Integer, String or others.

public void
updateAttributeRemoveObjectFromCollection(String attributeName, Object mapKey, Object value)

ADVANCED: Use this method when updating object attribute values, with unmapped objects Integer, String or others.

public void
updateAttributeWithObject(String attributeName, Object value)

ADVANCED: Use this method when updating object attribute values, with unmapped objects Integer, String or others.

Inherited from java.util.EventObject:
getSource

Field Detail

changeSetback to summary
protected ObjectChangeSet changeSet

For the post merge event it is possible that there has been a change set generated. This attribute will store the changeSet for the object just merged

dataRecordback to summary
protected DataRecord dataRecord

Optionally a database row may be provided on some events, (such as aboutToUpdate).

descriptorback to summary
protected ClassDescriptor descriptor
eventCodeback to summary
protected int eventCode

The code of the descriptor event being raised. This is an integer constant value from DescriptorEventManager.

eventNamesback to summary
protected static String[] eventNames

Event names for toString()

originalObjectback to summary
protected Object originalObject

The source object represents the object the event is being raised on, some events also require a second object, for example the original object in a postClone.

queryback to summary
protected DatabaseQuery query

The query causing the event.

sessionback to summary
protected AbstractSession session

The session in which the event is raised.

Constructor Detail

DescriptorEventback to summary
public DescriptorEvent(int eventCode, ObjectLevelModifyQuery query)

PUBLIC: Most events are trigger from queries, so this is a helper method.

DescriptorEventback to summary
public DescriptorEvent(Object sourceObject)

PUBLIC: All events require a source object.

Method Detail

applyAttributeValuesIntoRowback to summary
public void applyAttributeValuesIntoRow(String attributeName)

PUBLIC: Re-populate the database row with the values from the source object based upon the attribute's mapping. Provided as a helper method for modifying the row during event handling.

getChangeSetback to summary
public ObjectChangeSet getChangeSet()

PUBLIC: Returns the Object changeSet if available

getClassDescriptorback to summary
public ClassDescriptor getClassDescriptor()

PUBLIC: The source descriptor of the event.

getDescriptorback to summary
public ClassDescriptor getDescriptor()

PUBLIC: The source descriptor of the event.

getEventCodeback to summary
public int getEventCode()

PUBLIC: The code of the descriptor event being raised. This is an integer constant value from DescriptorEventManager.

getObjectback to summary
public Object getObject()

PUBLIC: Synanym for source.

getOriginalObjectback to summary
public Object getOriginalObject()

PUBLIC: The source object represents the object the event is being raised on, some events also require a second object, for example the original object in a postClone.

See Also
EventObject#getSource()
getQueryback to summary
public DatabaseQuery getQuery()

PUBLIC: The query causing the event.

getRecordback to summary
public DataRecord getRecord()

PUBLIC: Return the record that is associated with some events, such as postBuild, and aboutToUpdate.

getSessionback to summary
public AbstractSession getSession()

PUBLIC: The session in which the event is raised.

setChangeSetback to summary
public void setChangeSet(ObjectChangeSet newChangeSet)

INTERNAL: Sets the Change set in the event if the change Set is available

setDescriptorback to summary
public void setDescriptor(ClassDescriptor descriptor)

INTERNAL: The source descriptor of the event.

setEventCodeback to summary
public void setEventCode(int eventCode)

INTERNAL: The code of the descriptor event being raised. This is an integer constant value from DescriptorEventManager.

setOriginalObjectback to summary
public void setOriginalObject(Object originalObject)

INTERNAL: The source object represents the object the event is being raised on, some events also require a second object, for example the original object in a postClone.

setQueryback to summary
public void setQuery(DatabaseQuery query)

INTERNAL: The query causing the event.

setRecordback to summary
public void setRecord(DataRecord dataRecord)

INTERNAL: Optionally a database row may be provided on some events, (such as aboutToUpdate).

setSessionback to summary
public void setSession(AbstractSession session)

INTERNAL: The session in which the event is raised.

toStringback to summary
public String toString()

Overrides java.util.EventObject.toString.

INTERNAL:

Returns:String

Doc from java.util.EventObject.toString.

a String representation of this EventObject

Annotations
@Override
updateAttributeAddObjectToCollectionback to summary
public void updateAttributeAddObjectToCollection(String attributeName, Object mapKey, Object value)

ADVANCED: Use this method when updating object attribute values, with unmapped objects Integer, String or others. in events to ensure that all required objects are updated. EclipseLink will automatically update all objects and changesets involved. EclipseLink will update the field, in the row, to have the new value for the field that this mapping maps to. If the attribute being updated is within an aggregate then pass the updated aggregate and the attribute of the aggregate mapping into this method.

updateAttributeRemoveObjectFromCollectionback to summary
public void updateAttributeRemoveObjectFromCollection(String attributeName, Object mapKey, Object value)

ADVANCED: Use this method when updating object attribute values, with unmapped objects Integer, String or others. in events to ensure that all required objects are updated. EclipseLink will automatically update all objects and changesets involved. EclipseLink will update the field, in the row, to have the new value for the field that this mapping maps to.

updateAttributeWithObjectback to summary
public void updateAttributeWithObject(String attributeName, Object value)

ADVANCED: Use this method when updating object attribute values, with unmapped objects Integer, String or others. in events to ensure that all required objects are updated. EclipseLink will automatically update all objects and changesets involved. EclipseLink will update the field, in the row, to have the new value for the field that this mapping maps to.