Executing the view object query in Oracle ADF

In oracle ADF, for executing the view object query we need to write code for that.This code is needed for refreshing the table content after executing some DML operation.For that we need to execute the query of view object.For that write an in application module Impl.java file.For an example look the below code-

 


    public void refreshVinayView()
    {
VinayViewObject  vinay= get VinayViewObject 1();
        vinay.executeQuery();
    }

After writing in AppmoduleImpl.java file.save your application and double click on app module.Go to client interface and shuttle right to this method “refreshVinayView” .
After that From where you what to execute the view object query.For example- we are deleting some row from table and want to reexecute the query again then we can write the code in specific java file of some .jspx file.Sample code is as below.

   FacesContext fctx = FacesContext.getCurrentInstance();
        ValueBinding vb = 
            fctx.getApplication().createValueBinding("#{bindings}");
        DCBindingContainer dcb = (DCBindingContainer)vb.getValue(fctx);
        OperationBinding operation = 
            (OperationBinding)dcb.get("refreshVinayView ");
        operation1.execute();

One more thing needed.Go to page definition of that specific .jspx file. And in Binding tab in structure window.Right click the binding tab and go to method action.An “Action binding editor” window will open.Select your java method in SELECT AN ACTION drop down and press ok.

This is all you need to execute the view object the query.