Calling Exported View Row Methods

The client program must import the package containing the Java interface for the View Row Object, the View Object row-proxy, and the generic Application Module. For example:

import package4.common.*
// includes package4.common.DeptView
// includes package4.common.DeptViewImpl

import oracle.jbo.*
// includes generic Application Module oracle.jbo.ApplicationModule

To use the exported View Row accessor methods:

  1. Get an instance of the generic Application Module.

  2. Get a reference to the View Row object and cast it to the View Object row-proxy containing the exported accessor method.

  3. Work with the exported method.

For example:

// Call create() to get the application module instance;
// cast it to the custom application module
ApplicationModule am = session.createApplicationModule();
   // Get a reference to the View Object - Cast it to the custom  
// view object interface containing the exported method
ViewObject deptView = am.findViewObject("DeptView");
   // Call one of the View Object methods that return a row
while ((row = deptView.next()) != null)
   // Cast the row to the view row interface containing the 
// exported accessor method
DeptViewRow deptRow = (DeptViewRow) row
   // Call the accessor method on the row
System.out.println("DEPTNO :"+deptRow.getDeptNo());

Notice that if you are working with only the exported View Row method, you do not have to cast the Application Module to its exported interface.