Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Business Components
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.jbo.server
Interface EntityListener

All Known Implementing Classes:
  ViewObjectImpl

public interface EntityListener
extends java.util.EventListener

Implemented by classes that receive events generated by operations on Entity Object rows.

When an Entity Object's row data changes, listeners to row events are notified through a call to `sourceChanged()`. Listener's may be subscribed by calling `addEntityListener()`.

#### Overview of Entity Object event flow.

When a new row is created through a call to `createRow()` on a View Object, rows are created for the Entity Object. After the rows are initialized, a `STATE_CHANGE` event is sent to listeners with a new post state of `STATUS_NEW`. As the user sets attributes on this row, `ATTRIBUTE_CHANGE` events are sent. After the new row is successfully posted to database, a `STATE_CHANGE` event is sent to listeners with a new post state of `STATUS_UNMODIFIED`. That is, after posting, the new row becomes an unmodified old row.

For an existing row, no Entity Object event is sent when the row is brought into the cache. However, when the user causes the row to be locked, an `ATTRIBUTE_CHANGE` event is sent with the attribute values present in the cache before locking. Locking may refresh rows, replacing their data with new data from the database. After the row is locked, the first call to `setAttribute()` will generate a `STATE_CHANGE` event with the new post state `STATUS_MODIFIED`. Subsequent calls to `lock()` and `setAttribute()` will generate `ATTRIBUTE_CHANGE` events. Note that if `setAttribute()` is called without first calling `lock()`, `lock()` will be called implicitly, and will generate an event of its own. These events may be distinguished by the fact that the Entity Object's post state when `lock()` generates its event is `STATUS_UNMODIFIED`, but is `STATUS_MODIFIED` for the event generated by `setAttribute()`. As in the case of a new row, after the modified row is successfully posted to database, a `STATE_CHANGE` event is generated with a new post state of `STATUS_UNMODIFIED`.

When a row is removed the row it is first locked, if it is not locked already, generating an `ATTRIBUTE_CHANGE` event as described above. Second, a `BEFORE_REMOVE` event is sent. Third, the row is marked as removed and a `STATE_CHANGE` event is sent with a new post status of `STATUS_DELETED`. Finally, another `STATE_CHANGE` event is sent with a new post status of `STATUS_DEAD`.

Since:
  JDeveloper 3.0
See Also:
  `EntityListener`, `EntityEvent`, `EntityImpl`, `Entity`

Method Summary
`void` | `sourceChanged(EntityEvent event)` Event handler called by an event publisher to report that an Entity Object's row data has changed.

Method Detail

### sourceChanged

    public void sourceChanged(EntityEvent event)

  Event handler called by an event publisher to report that an Entity Object's row data has changed.
  Parameters:
    `event` - the event describing the change.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Business Components
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD