Sunday, March 24, 2013

Iterate through the vo.executeQuery() results in ADF

Some times we execute a ViewObject (VO) in the ApplicationModule (AM). We want to iterate through the results returned.

The following sample code snippet will do the same

public String autoComplete(){
       StockDetailsVOImpl vo = getStockDetailsVO();   
        vo.executeQuery();
        while (vo.hasNext()) {
            //Type case the returned row to the VORowImpl type
            StockDetailsVORowImpl newRow = (StockDetailsVORowImpl) vo.next();
          
            //use the getter and setter methods of RowImpl Class to get the respective column details
            newRow.getCloumName());
            }
        }

No comments:

Post a Comment