How to implement search filter using queryDSL in reactive programming(R2DBC)

121 views Asked by At

I am trying to create a search filter in a reactive application using spring boot webflux. What I am doing now is checking which search attributes are passed in the request and based on that preparing a JPQL and executing it. The problem what I am facing in that approach is I have to write nXn condition check if the total attribute count is n. Providing the search request message here.

search: {
    "empid": "",
    "firstName": "",
    "dateofjoining": "",
    "status": "",
    "department": ""
}

In this search user can search without entering any fields or they can enter all the fields. If nothing is entered will call a findAll method. But not sure how to implement if they enter any of the fields. Would like to know any utilities that I can use which supports R2DBC. Any example code / sudo code will be helpful.

0

There are 0 answers