• hibernate criteria Restrictions工具类用法


    1     CriteriaQuery cq = new CriteriaQuery(TSUser.class, dataGrid);
    2     // 查询条件组装器
    3     org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, user);
    4     Restrictions.or(Restrictions.ilike("userName", searchValue, MatchMode.ANYWHERE), Restrictions.ilike("realName", searchValue, MatchMode.ANYWHERE));
    5     Restrictions.or(Restrictions.ilike("userOrgList.tsDepart.departname", searchValue, MatchMode.ANYWHERE), Restrictions.ilike("userKey", searchValue, MatchMode.ANYWHERE));
    6     Restrictions.or(Restrictions.ilike("userQuarters", searchValue, MatchMode.ANYWHERE), Restrictions.ilike("userWork", searchValue, MatchMode.ANYWHERE));
    7     cq.add();
    8     this.systemService.getDataGridReturn(cq, true);
    9     TagUtil.datagrid(response, dataGrid);

    无限添加or

    1  List<TSUser> list = criteria.add(Restrictions.or(Restrictions.like("description", key,MatchMode.ANYWHERE),
    2                              Restrictions.or(Restrictions.like("name", key,MatchMode.ANYWHERE),
    3                            Restrictions.or(Restrictions.like("direct", key,MatchMode.ANYWHERE),
    4                            Restrictions.or(Restrictions.like("mainplay",key,MatchMode.ANYWHERE),
    5                                Restrictions.like("filearea", key,MatchMode.ANYWHERE)))))).list();
  • 相关阅读:
    (转)基于REST架构的Web Service设计
    WPF 简易的喷泉效果
    C# 取Visio模型信息的简易方法
    WPF TextBox按字节长度限制输入
    NPOI导出WPF DataGrid控件显示数据
    WPF--TextBlock的ToolTip附加属性
    【转】WPF 从FlowDocument中找到Hyperlink
    WPF 初学VisifireChart
    WPF 简易进度条效果
    WPF 简易的跑马灯效果
  • 原文地址:https://www.cnblogs.com/Eeexiang/p/8877304.html
Copyright © 2020-2023  润新知