Simple Attribute-level validation in Entity Object in ADF
In this section, we have described how to add a simple validation against an attribute Entity Object. We have an employee EO has an attribute called Salary, whenever a user tries to insert/update salary greater than 10000, the validation checks and throws an exception.
HR Schema (Oracle database ships with HR Schema)
Employee EO (Click here for instruction to create Employee EO)
Double click on the EmployeeEO >> Click Attribute >> Click Salary >> Click the Validation Rule > Click the +
icon to add a validation rule
Input the Rule as shown below. Here we are setting a rule; the Salary must be less than 10,000.
Click on the Failure Handling and input an error message. Click Ok.
Test the Validation
Right click on the AppModule.xml and select Run
In the AppModule wizard >> Double click on the EmployeeEO >> Input a Salary more than 10000 >> and click Commit as shown below. It will execute the validation, and throws an error message that it must be less than 10000.
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
Latest posts by Govind
- JSF Login Logout Form Authentication Example - October 16, 2017
- How to Bookmark URL in JSF using GET method and ViewParam – example - October 14, 2017
- JSF Dynamic Navigation and how to use wildcard in navigation - October 12, 2017