Databases Reference
In-Depth Information
Built-in declarative validators
ADF Business Components includes some built-in validators to support and apply validaions
for enity objects. The following screenshot explains how a declaraive validaion will show
up in the Overview tab:
The Business Rules secion for the EmpEO.xml ile will list all the validaions for the EmpEO
enity. In the previous screenshot, we will see that the there are no enity-level validators
deined and some of the atribute-level validaions are listed in the Atributes folder.
Collection validator
A Collecion validator is available only for enity-level validaion. To perform operaions such as
average , min , max , count , and sum for the collecion of rows, we use the collecion validator.
Collecion validators are compared to the GROUP BY operaion in an SQL query with a
validaion. The aggregate funcions, such as count , sum , min , and max are added to validate
the enity row. The validator is operated against the literal value, expression, query result,
and so on. You must have the associaion accessor to add a collecion validaion.
Time for action - adding a collection validator for the DeptEO file
Now, we will add a Collecion validator to DeptEO.xml for adding a count validaion rule.
Imagine a business rule that says that the number of employees added to department
number 10 should be more than five. In this case, you will have a count operaion for the
employees added to department number 10 and show a message if the count is less than
5 for a paricular department.
 
Search WWH ::




Custom Search