View criteria are structured criteria that you can use to assemble a WHERE clause. Instead of changing WHERE clauses using string manipulation, you may find it more efficient to use view criteria to assemble complex WHERE clauses in conjunctive normal form. For more information, see About View Criteria.
To use structured WHERE clauses:
ViewCriteria
class by calling
createViewCriteria()
on the view object instance. For example,
to create view criteria for the view object instance custOrdVO
, you could use the following code:
ViewCriteria vc = custOrdVO.createViewCriteria();
createViewCriteriaRow()
on the ViewCriteria,
for example:
ViewCriteriaRow promotionRow = vc.createViewCriteriaRow();
ViewCriteriaRow noPromRow = vc.createViewCriteriaRow();
promotionRow.setAttribute("OrderTotal", "> 500");
promotionRow.setAttribute("CreditLimit", "> 2500");
promotionRow.setAttribute("PromotionId", "IS NOT NULL");
noPromRow.setAttribute("OrderTotal", "> 1000");
noPromRow.setAttribute("OrderTotal", "> 5000");
vc.addElement(promotionRow);
vc.addElement(noPromRow);
custOrdVO.applyViewCriteria(vc);
setAttribute()
addElement()
removeElement()
null
to
applyViewCriteria()
Ways to Change View Object Queries at
Runtime
Ways to Change View
Object Queries at Runtime
About
Oracle ADF View Objects
About
View Object Attributes
Copyright © 1997, 2004, Oracle. All rights reserved.