How to Perform Validation through Method in Oracle ADF
In this post we will perform validation through Method in Oracle ADF and for this purpose will continue the previous post example.
Open the Failure Handling tab and type Message text.
In this example we will perform validation on Employee's First Name field and we will restrict the data entry operator to do not leave the first name field empty.
First we will generate and configure Java implementation class for Employee Entity Object. Double click on Employee Entity from model.eo package and Open Java tab. From the Java Classes click on yellow pencil button. From the newly opened window click to generate entity object class and also click to include Accessors.
Now create the validation for FirstName field. Select Method as Rule Type, Click the Create and Select Method and enter the Name of Method.
Again open the Java tab and click on model.eo.EmployeesImpl class link
The basic structure of the method is already been written and in this structure we will write our required code as shown
Run the AppModule from model.vo package. Open EmployeeView, enter Employee ID, leave the FirstName field empty and press enter. Our method will execute and give the required result as shown