模糊查询(like %)
hqlStr.append("and (t.ins_doc_name like :insDocName) ");
hqlParamMap.put("insDocName", "%"+insReportDto.getInsReport().getInsDocName()+"%");
精确查询(=)
hqlStr.append("and t.ins_doc_name=:insDocName ");
hqlParamMap.put("insDocName", insReportDto.getInsReport().getInsDocName());
本文介绍了在HQL中实现模糊查询和精确查询的方法。通过示例代码展示了如何使用like进行模糊查询,以及如何进行精确匹配。这对于理解数据库查询操作非常重要。
1345

被折叠的 条评论
为什么被折叠?



