Search code examples
oaf

OAF remove all rows from view object VO


I can not find a method to make the VO empty.

In collections it's rather straight-forward

arrayList.clear();

But there's no similar method in VO.


Solution

  • There are no normal method names because VO can have many row sets. For example, you can put query results with different parameters in different row sets and then work with both of them. VO is actually a list of lists, so all VO methods are named differently.

    One-liner solution

    vo.executeEmptyRowSet();
    

    If you need to handle each row individually

    vo.reset();
    while (vo.hasNext()) {
        oracle.jbo.Row row = vo.next()
        handleRow(row);
        row.remove();
    }