Skip to content
Advertisement

Handle optional parameters in QueryDSL

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

JavaScript

As in above I commented the NPException. How to use QueryDSL for optional Parameters in QueryDSL using Spring Data?

Thank you 🙂

Advertisement

Answer

BooleanBuilder can be used as a dynamic builder for boolean expressions:

JavaScript
Advertisement