hibernate - jpa query not returning results by applying OR clause -


i have use case search cities given stateid , if name present include in query , if description present include part of query. stateid mandatory if name or description not passed query not filter out result. have written jpql below need or condition between name , description. result , and of name , description

  • i need name or description.
  • also description should not match exact string passed should like matching string

    @query("select c city c (c.stateid=:stateid , ((:name null or c.name=:name) ,  (:description null or c.description=:description)))") 

where doing wrong in above query wrote.


Comments

Popular posts from this blog

Add new key value to json node in java -

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

javascript - Highcharts Synchronized charts with missing data points -