Spring data R2DBC Custom query builder

49 Views Asked by At

I am working with Postgesql, Hibernate, and R2DBC.

I am trying to create a custom query based on a lot of parameters.

I have the following JSON

{ status: ["Pending","Completed"], start_date: "2020-01-01", end_date: null }

and this should generate the following query:

SELECT * FROM tableName WHERE status IN ("Pending","Completed") AND due_date > "2020-01-01"

for example if status is not passed that section will be removed from the query.

How could I possibly do that?

0

There are 0 best solutions below