First page Back Continue Last page Text

oracle adf workshop


Using Entity Objects to Persist Data

Entity objects contain attributes, business rules, and persistence information that apply to a specific part of your business model. Entities are used to define a logical structure of your business, such as product lines, departments, divisions, and so on. They can also define physical items such as warehouses, employees, and equipment. For example, CustomerEO is an entity object.

An entity object is based on a data source; the example in the slide is based on the Customers table.

An entity’s attributes map to the columns of the data source; the CustomerEO entity has attributes called ID, Name, Status, and Email that map to the corresponding columns of the CUSTOMERS table.

You can attach validation rules to an entity object; the Status attribute has a validation rule that restricts status values to a list of valid values.

You retrieve and modify entity rows in the context of an application module that provides the database transaction. When your application module creates, modifies, or removes entity object rows and commits the transaction, changes are saved automatically.