Querydsl 结合 pg 的相关函数进行数据查询

builder.and(Expressions.booleanTemplate("FUNCTION('jsonb_contains', {0}, {1})",
                               dashboardReportsEntity.prepareReportViewMembers,
                               Expressions.template(JsonNode.class,"FUNCTION('to_jsonb', {0})", user.getUserId())).isTrue())
jsonb_contains ()是对应的函数方法,{0}, {1}是对应的参数,
Expressions.template(JsonNode.class,"FUNCTION('to_jsonb', {0})", user.getUserId())将数据转换为相同类型进行处理
posted @ 2023-10-12 16:11  代码红了一大片  阅读(80)  评论(0编辑  收藏  举报