zoukankan      html  css  js  c++  java
  • CUBA在查询语句如何添加参数

    browse.xml中的collectionDatasource 可以添加查询语句,使用 “= :custom$param”  的形式

    <collectionDatasource id="procActorsDs"
                          class="com.haulmont.bpm.entity.ProcActor"
                          view="procActor-browse">
        <query>
            <![CDATA[
            select pa from bpm$ProcActor pa where pa.procInstance.id = :custom$procInstance
            order by pa.procRole.order, pa.order
            ]]>
        </query>
    </collectionDatasource>

    然后在后台Controller类中添加这个参数,datasoure.refresh(params)

    public void refresh() {
        Map<String, Object> params = new HashMap<>();
        params.put("procInstance", procInstance);
        procActorsDs.refresh(params);
    }

    如果是在后台中查询,那参数设置就跟JPQL很像了

    public static ExcelTable findExcelTableById(DataManager dataManager, UUID entityId) {
        LoadContext ctx = LoadContext.create(ExcelTable.class).setView("_local");
        ctx.setQueryString("select et from cip$ExcelTable et where et.id = :entityId")
                .setParameter("entityId", entityId);
        return (ExcelTable) dataManager.load(ctx);
    }
  • 相关阅读:
    Windows的安全模型
    pefile解析PE格式
    在Linux下安装PyEmu
    Python的数据类型
    从pcap文件中分析出数据包
    Cuckoo架构
    Linux上调试python程序
    Linux关闭端口
    在Windows上安装部署Cuckoo
    分析由Python编写的大型项目(Volatility和Cuckoo)
  • 原文地址:https://www.cnblogs.com/acm-bingzi/p/cubaQueryParam.html
Copyright © 2011-2022 走看看