This blog is helpful for those who are new in Oracle ADF 12c as well as for the professionals. This blog contains the basic and advanced concept of Oracle ADF 12c.

Sunday 12 March 2017

How to create a custom sql based view object?


  • 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 "CustomSqlViewObject" and select the Data source as Custom SQL Query. Click next.

  • Now here write the select sql query or use query builder option to write query to fetch the data from db. and click next.


  • Now specify the bind variable for where clause in above query.

         Here we are not using any bind variable and click next.


  • Following db employee table column is mapped to view object attribute. Click next.



  • Here we will create new attribute or delete any attribute from view object, 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.



  • 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.


  • Custom SQL Based View Object is created.

0 comments:

Post a Comment

Social Profiles

Google Plus Email

Popular Posts

palash dabkara . Powered by Blogger.

Followers

Copyright © Oracle ADF 12c (Application Development Framework) Tutorial for Beginners | Powered by Blogger
Design by Palash Dabkara