Package org.apdplat.platform.criteria

Examples of org.apdplat.platform.criteria.PropertyCriteria


        json.append("]");

        return json.toString();
    }
    public Role getRootRole(){
        PropertyCriteria propertyCriteria = new PropertyCriteria(Criteria.or);
        propertyCriteria.addPropertyEditor(new PropertyEditor("roleName", Operator.eq, "String","角色"));
        Page<Role> page = serviceFacade.query(Role.class, null, propertyCriteria);
        if (page.getTotalRecords() == 1) {
            return page.getModels().get(0);
        }
        return null;
View Full Code Here


            message = "请输入用户名";
            LOG.info(message);
            throw new UsernameNotFoundException(message);
        }
        /* 取得用户 */
        PropertyCriteria propertyCriteria = new PropertyCriteria(Criteria.or);
        propertyCriteria.addPropertyEditor(new PropertyEditor("username", Operator.eq, "String",username));

        //PropertyEditor sub1=new PropertyEditor(Criteria.or);
        //sub1.addSubPropertyEditor(new PropertyEditor("id", Operator.eq, 1));
        //sub1.addSubPropertyEditor(new PropertyEditor("id", Operator.eq, 2));

View Full Code Here

     * @param orgId
     * @return
     */
    public PropertyCriteria buildPropertyCriteria(PropertyCriteria propertyCriteria, int orgId){
        if(propertyCriteria == null){
            propertyCriteria = new PropertyCriteria();
        }
        //orgId==-1或orgId<0代表为根节点,不加过滤条件
        if(orgId > 0){
            Org org = serviceFacade.retrieve(Org.class, orgId);
            //获取orgId的所有子机构的ID
View Full Code Here

     * 模型合法性检查
     * @param model 模型
     */
    public void checkModel(User model){
        /* 取得用户 */
        PropertyCriteria propertyCriteria = new PropertyCriteria();
        propertyCriteria.addPropertyEditor(new PropertyEditor("username", Operator.eq, "String", model.getUsername()));
        Page<User> pape = serviceFacade.query(User.class, null, propertyCriteria);
        if(pape.getTotalRecords() > 0){
            String message = "用户名【"+model.getUsername()+"】已存在,请更换用户名";
            LOG.error(message);
            //加快内存释放
View Full Code Here

        return json.toString();
    }
    public InfoType getRootInfoType(){
        try{
            PropertyCriteria propertyCriteria = new PropertyCriteria(Criteria.or);
            propertyCriteria.addPropertyEditor(new PropertyEditor("infoTypeName", Operator.eq, "String","新闻类别"));
            Page<InfoTypeContent> page = serviceFacade.query(InfoTypeContent.class, null, propertyCriteria);
            if (page.getTotalRecords() == 1) {
                return page.getModels().get(0).getInfoType();
            }
        }catch(Exception e){
View Full Code Here

        model.setLang(lang);
    }
    //方式二:使用IN语句
    @Override
    public PropertyCriteria buildPropertyCriteria(){
        PropertyCriteria propertyCriteria=new PropertyCriteria();
        if(infoTypeId>0){
            InfoType obj=getService().retrieve(InfoType.class, infoTypeId);
            //获取orgId的所有子机构的ID
            List<Integer> infoTypeIds=InfoTypeService.getChildIds(obj);
            //加上orgId
            infoTypeIds.add(obj.getId());
           
            PropertyEditor pe=new PropertyEditor("infoType.id", Operator.in, PropertyType.List, infoTypeIds);
            propertyCriteria.addPropertyEditor(pe);
           
            return propertyCriteria;
        }
         //infoTypeId==-1或infoTypeId<0代表为根节点,不加过滤条件
        return null;
View Full Code Here

TOP

Related Classes of org.apdplat.platform.criteria.PropertyCriteria

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.