java - Query creation in Spring Data - dynamic where clause -
is there way in spring data dynamically form clause?
what want have method (which findby / method) runs , and using mentioned properties not null.
for example,
consider object person [firstname, lastname, age, gender]
our method looks this
findby_ifnotnullfirstname_andifnotnulllastname_andifnotnullage_andifnotnullgender(string firstname, string lastname, integer age, string gender)
thanks.
take @ jpa specification , predicate, , better querydsl, there both supported spring data repositories. article provide example: http://spring.io/blog/2011/04/26/advanced-spring-data-jpa-specifications-and-querydsl/
Comments
Post a Comment