Create and Apply View Criteria with IN Clause and Other Clause Dynamically in ADF
Get the View Object instance
ViewCriteria vc = vo.createViewCriteria();
vc.setName("INCriteria");
String inClause = "IN (10,20,30,40)";
ViewCriteriaRow criteriaRow = vc.createViewCriteriaRow();
criteriaRow.setAttribute("DepatmentId", inClause);
vc.addElement(criteriaRow);
vo.applyViewCriteria(vc, true);
vo.executeQuery();
If you want to add the view criteria with equal clause then use following lines of code :
ViewCriteria vc = vo.createViewCriteria();
ViewCriteriaRow criteriaRow = vc.createViewCriteriaRow();
criteriaRow.setAttribute("DepatmentId",10);
vc.addElement(criteriaRow);
lovVO.applyViewCriteria(vc, true);
lovVO.executeQuery();
ViewCriteria vc = vo.createViewCriteria();
vc.setName("INCriteria");
String inClause = "IN (10,20,30,40)";
ViewCriteriaRow criteriaRow = vc.createViewCriteriaRow();
criteriaRow.setAttribute("DepatmentId", inClause);
vc.addElement(criteriaRow);
vo.applyViewCriteria(vc, true);
vo.executeQuery();
If you want to add the view criteria with equal clause then use following lines of code :
ViewCriteria vc = vo.createViewCriteria();
ViewCriteriaRow criteriaRow = vc.createViewCriteriaRow();
criteriaRow.setAttribute("DepatmentId",10);
vc.addElement(criteriaRow);
lovVO.applyViewCriteria(vc, true);
lovVO.executeQuery();
Comments
Post a Comment