If you need to assign bind variable values or modify where clause conditionally just before the the query execution
ViewObjectImpl::prepareRowSetForQuery(ViewRowSetImpl vrs)
This method engages well with ViewObjectImpl::getQueryHitCount()and ViewObjectImpl::getEstimatedRowCount() as well. I mean the prepareRowSetForQuery(...) will get invoked before calling the the above methods by the runtime.
This is useful if you need to set bind variable values before the query execution for List Of Values or ViewAccssors used for displaying Tree components.
You can use this method safely(zero side effect) to add your logic for tweaking default query by setting bind variable values or additional where clause at run time.
Example:
public class DepartmentsViewObjectImpl extends ViewObjectImpl{
...
@Override
public void prepareRowSetForQuery(ViewRowSetImpl vrs) {
vrs.ensureVariableManager().setVariableValue("bindVarDeptId", deptIdRuntimeValue);
super.prepareRowSetForQuery(vrs);
}
Hope this will help you
ViewObjectImpl::prepareRowSetForQuery(ViewRowSetImpl vrs)
This method engages well with ViewObjectImpl::getQueryHitCount()and ViewObjectImpl::getEstimatedRowCount() as well. I mean the prepareRowSetForQuery(...) will get invoked before calling the the above methods by the runtime.
This is useful if you need to set bind variable values before the query execution for List Of Values or ViewAccssors used for displaying Tree components.
You can use this method safely(zero side effect) to add your logic for tweaking default query by setting bind variable values or additional where clause at run time.
Example:
public class DepartmentsViewObjectImpl extends ViewObjectImpl{
...
@Override
public void prepareRowSetForQuery(ViewRowSetImpl vrs) {
vrs.ensureVariableManager().setVariableValue("bindVarDeptId", deptIdRuntimeValue);
super.prepareRowSetForQuery(vrs);
}
Hope this will help you
No comments:
Post a Comment