Menu

Invoking Application Module from Java

ADF By Jan 09, 2013 No Comments

Below code snippet will allow us to access the application
module from java class.
In this code, I was trying to get records from the table.
For this, I have got the view object from the application
module and applied a view criteria on the view object through which I got the
records row.
/*Accessing Application Module*/
       
AppModuleImpl appModule =
           
(AppModuleImpl)ADFUtils.getApplicationModuleForDataControl(“AppModuleDataControl”);
/*Accessing View Object from App Module. Here,
User_infoView is my own view created in App module*/
       
ViewObjectImpl voImpl = appModule.getUser_infoView1();
        ViewCriteria
vc = voImpl.createViewCriteria();
       
ViewCriteriaRow vcRow = vc.createViewCriteriaRow();
       
vcRow.setAttribute(“firstname”, “= ‘anand'”);
       
vc.add(vcRow);
       
voImpl.applyViewCriteria(vc);
       
voImpl.executeQuery();
       
System.out.println(“Query: ” + voImpl.getQuery());
        while
(voImpl.hasNext()) {
            Row row
= voImpl.next();
            String[]
attributeNames = row.getAttributeNames();
            for (int
index = 0; index < attributeNames.length; index++) {
                    System.out.println(“Required:
” +row.getAttribute(attributeNames[index]));
            }
        }

No Comments

Leave a comment

Hi, Welcome here.
JOIN OUR NEWSLETTER
And get notified everytime we publish a new blog post.