How to check if a pair exists using HQL in query?
<p>I have a list of different ids and their names. For every <code>id[0]</code> we have <code>name[0]</code> that needs to be matched.</p>

<ul>
<li>list of ids, <code>l{1,2,3,4};</code></li>
<li>list of names, <code>n{a,b,c,d};</code></li>
</ul>

<p>Now suppose if I want to get an exact match for both above combination, is there any way in HQL to get the result?</p>

<p>I am looking to find a replacement for a query like:</p>

<pre class="lang-sql prettyprint-override"><code>select any_column 
from table_name 
where (id[0]=1 and name[0]=a) or (id[1]=2 and name[1]=b and so on...);
</code></pre>

<p>The HQL query should be something like below:</p>

<pre class="lang-sql prettyprint-override"><code>select any_column 
from table_name 
where (id,name) IN {(id[0],name[0]), (id[1], name[1]),...};
</code></pre>

<p>Any suggestions?</p>