Handle optional parameters in QueryDSL(处理 QueryDSL 中的可选参数)
问题描述
我正在使用带有 SpringData 的 QueryDSL.我有表说,Employee
,我创建了实体类说,EmployeeEntity
我写了以下 service 方法
I am using QueryDSL with SpringData.
I have Table say, Employee
and I have created entity class say, EmployeeEntity
I have written following service method
如上所述,我注释了 NPException
.如何使用 Spring Data 将 QueryDSL 用于 QueryDSL 中的可选参数?
As in above I commented the NPException
. How to use QueryDSL for optional Parameters in QueryDSL using Spring Data?
谢谢你:)
推荐答案
BooleanBuilder
可以用作布尔表达式的动态构建器:
BooleanBuilder
can be used as a dynamic builder for boolean expressions:
这篇关于处理 QueryDSL 中的可选参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!