25 May 2011

ViewObjectImpl::prepareRowSetForQuery (new method in 11.1.1.5.0) - differences with executeQueryForCollection

Last Update: 26/5/2011

Check Jobinesh's post (Preparing ViewObject's query for execution) for its use, because API does not provide any description. This is a new method in ADF 11.1.1.5.0.
Quoting him:
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.

Finally, in the post's comments, Jobinesh  clarified the difference of using the prepareRowSetForQuery and executeQueryForCollection:
Why use this one and not executeQueryForCollection?
Well..good question. A couple of points for not using executeQueryForCollection...
1. The executeQueryForCollection(...) will never get invoked before getEstimatedRowCount() which is used for identifying the total result size. This may have serious side effects if you are modifying the query from executeQueryForCollection, as two different queries are getting executed - one for VO and the other on for rowCount. Table/Tree table will check for row count first and then displays records

2. If you need to modify the bind parameters values present in the query, executeQueryForCollection(..) is not the place as its too late and the values has already been extracted for execution


Many thanx to Jobinesh for clarifying this.

No comments:

Post a Comment

You might also like:

Related Posts Plugin for WordPress, Blogger...