Posts Tagged ‘entity object’

Environment (JDeveloper 11.1.1.5.0, ADF BC, hr schema)

Most of us know how we can add a validation rule using methodValidator on an attribute. However, this is not the only way that we can add a business rule for an attribute, we can add our business rule in the setter method for that attribute.

In this post I will explain how to add business rule in the setter method of an attribute and describe the difference if we add a business rule using methodValidator. This example based on hr schema, mainly on Employees table, and supposed that you already have built your BC. Our business rule is that the PHONE_NUMBER column should be at least 9 digits.

First Part.

The first part of this example is to add a business rule using  validatePhoneNumber method as shown below.

/**
     * Validation method for PhoneNumber.
     */
public boolean validatePhoneNumber(String phonenumber) {

View original post 460 more words

Entity Objects

Entity objects map to single objects in the datasource. In the vast majority of cases, these are tables, views, synonyms, or snapshots in a database. Entity objects handle the posting of changes to the datasource. 

Entity objects provide a hook for implementing your application’s business rules, including:

 

  • Validation logic, which keeps corrupt data from being entered in the database
  • Security logic, which tracks data changes and ensures that only authorized users can see or change data
  • Creation logic, which performs actions (such as prepopulating attributes) for newly created rows
  • Deletion logic, which performs actions when rows are deleted
  • Other logic, such as dynamic calculations and events that trigger when data is modified

View Objects

Oracle ADF view objects are business components that collect data from the datasource, shape that data for use by clients, and allow clients to change that data in the Oracle ADF Business Components cache. For example, a view object can gather all the information needed to:

  • Populate a single table element in a form
  • Create and process an insert or edit form
  • Create an LOV for populating a dropdown list

ViewObject decribes how the application will view and update data. A view object may be entity based or non-entity based. In the former case, the view object consists of one or more entity bases. The first one of these is referred to as the primary entity base. The rest are called secondary entity bases. An entity based view object maps its attribute (view attributes) to attributes in the entities (entity attributes). An entity based view object may map all its entity attributes or only some of them.

A non-entity based view object is one where it does not have any entity base. All its attributes are view level attributes. In this case only READ operation is allowed from the VO.

http://docs.oracle.com/cd/B14099_19/web.1012/b14022/oracle/jbo/ViewObject.html

http://download.oracle.com/otn_hosted_doc/jdeveloper/1012/bc4j/intro/bc_avo.html