View Objects and View Links in OAF
View Objects
- View Objects are used when we want some data to be displayed on page.
- View Objects are used just for displaying purpose.
- View Objects access the result set of a SQL statement, it can be either based on the Entity Object or plain SQL query.
- All the view objects ends with the VO
Example: EmployeeVO
When we create the View Object (VO) one subclass will
generate with setters and getters method.
We have four types of View Objects
and they are:
- Manual VO
- Automatic VO
- Validation VO
- Property VO
1) Manual VO: If we are writing our own SQL query then it will be called as Manual VO.
2) Automatic VO: Automatic VO is when we select an Entity Object automatically it will select the Query.
Difference between Manual and Automatic VO is:- If we want to perform DML operations then we can go for VO that should be based on Entity Object.
- We go for Manual VO if we are using simple SELECT
statement.
NOTE: Note that when we create VO (View Object) all the table columns will be converted into attributes, hence here we call columns as attributes.4)Validation VO: Validating the data in the Data Base, example using WHERE condition in the SELECT statement.5)Property VO: Attributes / columns without Data Base columns comes under property VO. These attributes are also called as Transient attributes.Example: Suppose there is a table which holds student marks so therefore it contains 6 columns to hold six subject marks for each student. There is no total column in the table to store the total marks of the student separately. Now in the output for display purpose we are taking TOTAL attribute, hence which is not from Data Base table and this TOTAL attribute is called Transient attribute.View LinksRelationship between two View Objects having one common column in both the VO’s is called View Link. All the View Link objects end with the VLExample: DeptEmpVLNote:That if we want to display Master Detail data then we go for View Links, where as if we want to perform DML operations on Master Detail data we go for Entity Association.The below figure shows that how View Objects and View Links are interacting with Data Base, VO interacts with Data Base Directly or VO interacts with Data Base through the EO.
No comments:
Post a Comment