Hi all,
I am using JDeveloper 11g with ADF BC.
I've try to create a method in VO to iterate through all the rows to calculate sum as following:
Row curItem = first();
while (curItem!=null) {
Long l = DbsDelegate.attributeAsLong(curItem.getAttribute("field1"));
if (l != null)
result+= l.longValue();
curItem = next();
}
I found it is not a good practice. Since the cursor will jump to the last record after that. And most important, the next() method call will fire a NavigationEvent to registered RowSetListeners, by calling RowSetListener.navigated() as documented here: http://www.bisnis.com/doc/rt/oracle/jbo/server/ViewObjectImpl.html#next%28%29
Is there any better way to iterate through a VO and calculate some summary data?
Regards,
Samson Fu