1 public void sampleMethod() { 2 //getting reference to deptVO 3 ViewObjectImpl deptVO = this.getDeptVO(); 4 //setting range size to -1 to get all dept rows 5 deptVO.setRangeSize(-1); 6 //getting all dept rows 7 Row[] deptRows = deptVO.getAllRowsInRange(); 8 //iterating through all dept rows 9 for (int i = 0; i < deptRows.length; i++) { 10 //getting reference to each dept row. Note that we're type casting the VO reference type to DeptVORowImpl. 11 DeptVORowImpl deptRow = (DeptVORowImpl)deptRows[i]; 12 //printing dept name 13 System.out.println("Employees in dept: " + 14 deptRow.getAttribute("Dname")); 15 //For each dept row, getting reference to empVO which contains all employees corresponding to current dept 16 RowIterator empRows = deptRow.getEmpVO(); 17 //iterating each emp row 18 while (empRows.hasNext()) { 19 Row empRow = empRows.next(); 20 //printing emp name from each row 21 System.out.println(empRow.getAttribute("Ename")); 22 } 23 } 24 }