oracle.jbo.server
Class EntityEvent
java.lang.Object
|
+--java.util.EventObject
|
+--oracle.jbo.server.EntityEvent
- All Implemented Interfaces:
- java.io.Serializable
- public class EntityEvent
- extends java.util.EventObject
An event delivered to an
EventListener
to notify of changes to data at
the Entity Object level.
The event type, which indicates the cause of the event,
is one of ATTRIBUTE_CHANGE
, STATE_CHANGE
,
or BEFORE_REMOVE
.
ATTRIBUTE_CHANGE
events contain
indices of changed attributes, as well as an array of the old attribute values.
STATE_CHANGE
events contain the old post state.
- Since:
- JDeveloper 3.0
- See Also:
EntityListener
,
EntityImpl
, Serialized Form
Type | Field |
static int |
ATTRIBUTE_CHANGE
An event type indicating that the Entity Object's attribute data has
changed; that is, setAttribute() has been called for the Entity Object. |
static int |
BEFORE_PK_CHANGE
An event type indicating that the Entity Object's primary key is about to
change; that is, setAttribute() has been called on a primary
key attribute for the Entity Object. |
static int |
BEFORE_REMOVE
An event type indicating that the Entity Object's row is to be removed. |
static int |
STATE_CHANGE
An event type indicating that the Entity Object's post state data has
changed. |
Fields inherited from class java.util.EventObject |
source |
EntityEvent(EntityImpl source,
int eventType,
int oldState,
int[] changedColumns,
java.lang.Object[] origValues)
Constructs a new Entity Object event. |
EntityEvent(EntityImpl source,
int eventType,
int oldState,
int[] changedColumns,
java.lang.Object[] origValues,
Key newKey)
|
Methods inherited from class java.util.EventObject |
getSource, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ATTRIBUTE_CHANGE
public static final int ATTRIBUTE_CHANGE
- An event type indicating that the Entity Object's attribute data has
changed; that is,
setAttribute()
has been called for the Entity Object.
- See Also:
getEventType()
STATE_CHANGE
public static final int STATE_CHANGE
- An event type indicating that the Entity Object's post state data has
changed.
- See Also:
getEventType()
,
EntityImpl
BEFORE_REMOVE
public static final int BEFORE_REMOVE
- An event type indicating that the Entity Object's row is to be removed.
- See Also:
getEventType()
BEFORE_PK_CHANGE
public static final int BEFORE_PK_CHANGE
- An event type indicating that the Entity Object's primary key is about to
change; that is,
setAttribute()
has been called on a primary
key attribute for the Entity Object. The value has not yet been assigned
to the Entity Object.
- See Also:
getEventType()
EntityEvent
public EntityEvent(EntityImpl source,
int eventType,
int oldState,
int[] changedColumns,
java.lang.Object[] origValues)
- Constructs a new Entity Object event.
- Parameters:
source
- the Entity Object row that fired the event.eventType
- the type of event. One of
ATTRIBUTE_CHANGE
,
STATE_CHANGE
,
or BEFORE_REMOVE
.oldState
- the post state of Entity Object row before it was
changed. This parameter is relevant only for
STATE_CHANGE
events.changedColumns
- an array of the indices of changed attributes.
This parameter is relevant only if the event type is ATTRIBUTE_CHANGE
.origValues
- an array of the previous attribute values.
This parameter is relevant only if the event type is ATTRIBUTE_CHANGE
.
EntityEvent
public EntityEvent(EntityImpl source,
int eventType,
int oldState,
int[] changedColumns,
java.lang.Object[] origValues,
Key newKey)
getEntity
public final EntityImpl getEntity()
- Gets the Entity Object that fired the event.
- Returns:
- the Entity Object.
getEventType
public int getEventType()
- Gets the Entity Object's event type.
- Returns:
- one of
ATTRIBUTE_CHANGE
,
STATE_CHANGE
, or BEFORE_REMOVE
.
getOldState
public int getOldState()
- Gets the Entity Object's previous post state.
This method is relevant only if the event type is
STATE_CHANGE
.
- Returns:
- the old post state.
getChangedColumns
public int[] getChangedColumns()
- Constructs an array of the indices of the changed attribute.
This method is relevant only if the event type is
ATTRIBUTE_CHANGE
.
- Returns:
- the array of attribute indices.
getOldValues
public java.lang.Object[] getOldValues()
- Gets the attribute's old values.
This method is relevant only if the event type is
ATTRIBUTE_CHANGE
.
- Returns:
- an array of old attribute values.
getNewKey
public Key getNewKey()