How to write a query with conditions such as A And (B Or C) with Spring Data query methods? -


based on spring data documentation, easy conditions such or b. example:

list<person> findbylastnameorfirstname(string lastname, string firstname); 

i wouild know how write query conditions , (b or c). following:

list<person> findbyemailaddressand(lastnameorfirstname)(string emailaddress, string lastname, string firstname); 

thanks , regards.

you can use @query annotation.

@query("select p person p p.emailaddress=:emailaddress , (p.lastname=:lastname or p.firstname=:firstname)") list<person> findbyemailaddressand(lastnameorfirstname)(string emailaddress, string lastname, string firstname); 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -