You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by David Beer <da...@gmail.com> on 2013/07/25 14:47:56 UTC

Build SQL Query

Hi All

I am trying to add a query which contains multiple search items. The 
user can enter/select one or up to three values to search against. I 
won't necessarily know which values they have selected except through 
checking if the item is null. The problem is how best do I create a 
query which I can build which is basically a WHERE clause and using AND 
to define the extra values. Would I have to write the SQL manually or is 
there a way to build the query using CriteriaQuery and CriteriaBuilder?

Thanks

David