Validation
View Object
When
you implement business logic in your entity object, you will frequently find
that you need to execute some simple sql statements, and not just for pure
validation purpose.
For
ex:-
A
purchase order header has many lines. Each line assigned to unique line number.
This
line is defined as the current maximum line number for the entire purchase
order +1. At run time, we need to query the database to find out the what the
maximum line number is for a given purchase order header.
Select max (line_num)
from po_lines_all where po_header_id =:1;
Whenever
you need to execute the sql like this, you can create view object dynamically
from a sql statement, or you can predefine a declarative view object for it.
For
an implementation standpoint, validation view object are no different from
regular view object, they are different only by the use case.