- Follow the post "How to create an Oracle ADF Fusion Web Application?", to create an application, change the application name and suffix.
- Now create an entity object refer to the post "How to create an Entity Object in Jdeveloper 12c?".
- Now start creating view object.
Right click on the model project and
select the view object from gallery.
- Now give the name of view object, Lets say "EntityBasedViewObject" and select the Data source as Entity.
click next.
- Now you will find the list of entity objects on left side , here we have one entity object "EmployeeEO" , So select it and shuffle to right side. By default Updatable checkbox is selected.
- If you want to do DML opeartion on entity object based on this view object then select the checkbox updatable.
Here unchecked this option. and click
next.
- Now the attributes available on entity object is shown on left side, so shuffle the attributes which you want to use on view object.
Here we will select EmployeeId, FirstName
and LastName. and click next.
- Now for each attribute specify the constraints.
Query Column section shows the db
employee table column name which is mapped to this view object attribute.
click next.
- Following screen appears.
Here by default checkbox is selected
"Calculated Optimize Criteria at Runtime", this option will
automatically perform the select operation on this view object.
we can also specify the where clause
but for this, view criteria is mandatory, creation of view criteria will be
discussed on other post.
Here we are not creating where clause.
If you want sort the result on the
basis of any fields then choose attributes on the order by section from which we
have to sort.
click next.
- Following screen appears.
Here create a bind variable to perform
a where clause on query by using this variable, no need of creating a view
criteria.
here we are not creating any bind
variable.
click next.
- Now following option shown to create java class:-
View Object
Class :-
this class is used to work programmatically with view object, this class
overrides the method of ViewObjectImpl class, that works to perform result on
view object.
View Row
Class :-
This class is used when work with only one row, it implements the
ViewRowImpl class.
Service Data Objects :- If want to use view object as a
service, then create this class.
Here we are not doing any customization so unselect all
checkbox and click next.
- If want to work with this view object on view layer then create view object instance on Application module impl xml file.
click next.
- Following structure of view object, and click finish.
- Entity Based view Object is created.
0 comments:
Post a Comment