Databases Reference
In-Depth Information
The Regular Expression validator
For example, let us consider that we have a validaion rule to check if the e-mail ID provided
by the user is in the correct format. For the e-mail validaion, we have some common rules
such as the following:
The e-mail ID should start with a string and end with the @ character
The e-mail ID's last character cannot be the dot (.) character
Two @ characters are not allowed within an e-mail ID
For this purpose, ADF provides a declaraive Regular Expression validator. We can use the
regex patern to check the value of the atribute. The e-mail address and the US phone
number patern is provided by default:
Email : [A-Z0-9._%+-]+@[A-Z0-,9.-]+\.[A-Z]{2,4}
Phone Number (US) : [0-9]{3}-?[0-9]{3}-?[0-9]{4}
You should select the required patern and then click on the Use Patern buton
to use it. Matches and NotMatches are the two operators that are included
with this validator.
The Script validator
If we want to include an expression and validate the business rule, the Script validator
is the best choice. ADF supports Groovy expressions to provide Script validaion for
an atribute.
The UniqueKey validator
This validator is available for use only for enity-level validaion. To check for uniqueness in
the record, we would be using this validator. If we have a primary key deined for the enity
object, the Uniqueness Check Deiniion secion will list the primary keys deined to check
for uniqueness, as shown in the following screenshot:
If we have to perform a uniqueness check against any atribute other than the primary key
atributes, we will have to create an alternate key for the enity object.
 
Search WWH ::




Custom Search