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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -