Overview
The business logic unit is provided in Oracle ADF, which is very practical in practical applications, the verification logic of the record varies depending on the field value of different records in the table. This article describes how to apply business logic unit.
Requirement
According to the job_id of different records in the Employees table, add different verification logic for its salary. In this example, set the Label display and verification logic for the salary attribute of the employee whose job_id is ad_vp.
Implementation
1. Create an ADF Application
2. Create entity object and view object according to the Employees table in HR schema, create application module, and add the instance of this view object to the data model in application module
3. Open employees entity object and add the business logic groups named "jobidgroup" to its General Panel. Here, select "group discriminator attribute" as jobid
3. Add business logic unit for the employees entity object, right-click the entity object, and select:
4. Create a business logic unit and fill in the relevant information:
5. Select attributes panel in the created business logic unit. Because you need to set the authentication logic for the salary attribute of the employee whose job_id is ad_vp, override this attribute is required.
6. Set the control hints of this attribute and set the label text of salary to ad_vp salary.
7. Add verification and set salary's upper limit to 100000. If the upper limit is exceeded, an error message is displayed.
8. Run the application and view the result.
This article is transferred from Oracle Seeker: http://oracleseeker.com/2009/11/12/adf_entity_business_logic_unit/