ViewCriteria的多项连接

    /**
     * 查询年级专业是否有些专业还没有设置学费
     */
    private boolean hasEmptyFy(String njAttr) {
        boolean flag = false;
        SfglXfViewImpl vo =
            (SfglXfViewImpl)ADFUtils.findIterator("SfglXfView1Iterator").getViewObject(); //学费vo
        ViewCriteria vc = vo.createViewCriteria();
        vc.setName("criteria");
        ViewCriteriaRow vcRow = vc.createViewCriteriaRow();
        vcRow.setAttribute("Nj", "in (" + njAttr + ")");
        vc.add(vcRow);
        ViewCriteriaRow vcRow2 = vc.createViewCriteriaRow();
        vcRow2.setConjunction(ViewCriteriaComponent.VC_CONJ_AND); //连接关系
        vcRow2.setAttribute("Fy", "is null");
        vc.add(vcRow2);
        RowIterator it =
            vo.findByViewCriteria(vc, -1, vo.QUERY_MODE_SCAN_DATABASE_TABLES);
        if (it.getRowCount() > 0) {
            flag = true;
        }
        vo.removeViewCriteria("criteria");
        return flag;
    }

 ----摘自收费管理系统,生成全部学费设置

你可能感兴趣的:(ViewCriteria的多项连接)