Rowqualifier is used in ADF to programmatically filter rows. This can be used to filter the ViewObject based on one or more where clauses.
For example: If you have an employeeViewObject containing information of the employees and you want to fetch the record of the employees for some particular department. In this case, RowQualifier can be used.
RowQualifier filters the rows from the Memory. i.e. first it loads all the records of the ViewObject in the memory and then filtered the row.
I have created a method in ApplicationModuleImpl to filter the rows of EmployeeVO on the basis of the RowQualifier.
On executing the method below result is printed.
We can also filter the rows using ViewCriteria in ADF Application.
What is ViewCriteria in ADF??
For example: If you have an employeeViewObject containing information of the employees and you want to fetch the record of the employees for some particular department. In this case, RowQualifier can be used.
RowQualifier filters the rows from the Memory. i.e. first it loads all the records of the ViewObject in the memory and then filtered the row.
Tip: Never user RowQualifier on a table with large no. of records as it will take time to load all the rows into the memory and then run the filter. The application may take some time to process the request.
I have created a method in ApplicationModuleImpl to filter the rows of EmployeeVO on the basis of the RowQualifier.
1 2 3 4 5 6 7 8 9 10 | public void getEmployeeOfDepartment(Integer DepartmentId) { // Employee ViewObject Instance ViewObjectImpl employeeVO = getEmployeeVO1(); System.out.println("Employee Count :" + employeeVO.getRowCount()); // Creating rowQualifier for EmployeeVO RowQualifier rQlfr = new RowQualifier(employeeVO); rQlfr.setWhereClause("DepartmentId =" + DepartmentId); Row[] filteredRows = employeeVO.getFilteredRows(rQlfr); System.out.println("Employees in Department 10 :" + filteredRows.length); } |
On executing the method below result is printed.
We can also filter the rows using ViewCriteria in ADF Application.
What is ViewCriteria in ADF??
No comments:
Post a Comment