Consider the validation code in a Shipping entity object that is designed to ensure that the date ordered is <=
the date shipped.
public boolean validateDateShippedAfterDateOrdered() {
Date DateShipped = getDateShipped();
Date DateOrdered = qetDateOrdered();
if (DateShipped != null && DateShipped.compareTo(DateOrdered) < 0) {
return false;
}
return true;
}
Which entity object validation rule should you integrate this with? (Choose the best answer.)
A.
compare validator on the DateShipped attribute
B.
method validator on the DateShipped attribute
C.
compare validator on the DateOrdered attribute
D.
range validator on the Shipping entity object
E.
method validator on the Shipping entity object
Explanation:
If the validity of one attribute is dependent on one or more other attributes, enforce this rule using entity
validation, not attribute validation. Examples of when you would want to do this include the following:
You have a Compare validator that compares one attribute to another.
You have an attribute with an expression validator that examines the value in another attribute to control
branching in the expression to validate the attribute differently depending on the value in this other attribute.
You make use of conditional execution, and your precondition expression involves an attribute other than
the one that you are validating.
https://docs.oracle.com/cd/E24382_01/web.1112/e16182/bcvalidation.htm#ADFFD411
Correct answer is E
Explanation states that it would be entity-level method validator and yet the answer is wrong.
Reference : https://docs.oracle.com/middleware/12213/adf/develop/implementing-validation-and-business-rules-programmatically.htm#ADFFD459
The same example is explained in the link ablove