title: JPA named query match a list of tuples in IN clause
body: <p>spring data jpa 1.4.3 with Oracle 11g.</p>
  
  <p>I have an entity like this:</p>
  
  <pre><code>class LinkRecord {
    String value;
    int linkType;
    ...
  }
  </code></pre>
  
  <p>I am using (value, linkType) as a composite index.
  For a given list of (v, t) tuples, we need to select all the records in the DB so that value = v, linkType = t.</p>
  
  <p>Basically, I want to build this query:</p>
  
  <pre><code>SELECT * FROM LINK_RECORD WHERE (VALUE, LINK_TYPE) IN (('value1', 0), ('value2', 25), ...)
  </code></pre>
  
  <p>where the list in the IN clause is passed in as a param.</p>
  
  <p>Since we're working with a large volume of data, it would be very undesirable to query for the tuples one by one.</p>
  
  <p>In my repository I've tried this:</p>
  
  <pre><code>@Query("select r from LinkRecord r where (r.value, r.linkType) in :keys")
  List&lt;LinkRecord&gt; findByValueAndType(@Param("keys")List&lt;List&lt;Object&gt;&gt; keys);
  </code></pre>
  
  <p>where keys is a list of (lists of length 2). This gets me ORA_00920: invalid relational operator.</p>
  
  <p>Is there any way to make this work using a named query? Or do I have to resort to native sql?</p>