Wednesday, April 28, 2010

ADF:usage of RowQualifier

A useful note , for those who are not aware of this cool feature of ADFbc..
Like we apply ViewCriteria on the ViewObject, we can apply similar SQL structured WHERE clause predicate on the ViewObject ResultCache in middle tier..(not in the DB)...using RowQualifier(oracle.job.server.RowQualifier)

            //Create a new RowQualifier object with the filtering condition.
RowQualifier qualf = new RowQualifier("ApplicationId = "+applicationId+" AND ContextName ='"+contextName+"'");

//Filtered the rowset based on Attribute applicationId and the value user passes.
Row[] rows = getContextVO().getFilteredRows(qualf);


The above Rowqualifier constructs a middle tier WHERE clause predicate and apply on the ViewObject resultset.

The major advantage of RowQualifier on VC is, like VC we dont need a design time artifact on VO, nor do we need to write complicated code for programmatic implementation..This is quick and instantaneous..

6 comments:

Anonymous said...

great post. could you please give more details.
where to write this snippet.
a simple app would be very appreciated!
thx in advanced!

jimmy jam said...

This erases all temporary files in that are being generated during a build of an application. Only things that can be rebuilt are removed in this step. tech blog

Technology Blog said...

Technology is not just limited to our homes; it is part of our educational systems, businesses, health care organizations and every single place where human efforts are involved.

Technology Blog

alkhateeb said...

There is a performance issue of using RowQualifier it appears when you have a lot of rows.

BOSS said...

We can do this ViewObjectImpl as follows:

ViewObjectImpl voi = (ViewObjectImpl) getViewObject();

RowQualifier rq = new RowQualifier(voi);
rq.setWhereClause("Attribute1="+1+" AND Attribute2="+"222");

Row[] rows = voi.getFilteredRows(rq);

Susovan Maji said...

How to add more than 3 condition in the row qualifier ???
working for 2, bt not working for more than that