Is there a way in Spring for dynamically generating where clauses?
What I want to do is to have a method (which is similar to the findBy / get method) that runs WHERE and AND, using the specified properties that are not NULL.
For example,
Consider the object Person [firstName, lastName, age, gender]
Our method looks something like this.
findBy_IfNotNullFirstName_AndIfNotNullLastName_AndIfNotNullAge_AndIfNotNullGender(String firstName, String lastName, Integer age, String gender)
Thanks.
source
share