title: SQL Server + hibernate composite key fails on IN predicate
body: <p>I'm migrating some project on Hibernate (I'm not sure about version it is embedded to JBoss5.1.0GA looks like 3.x) from Oracle to SQL Server.</p>
  
  <p>One of the queries on HQL looks like:</p>
  
  <pre><code>...
  FROM k join k.defs kd
    ...
  WHERE ...
     kd not in ( SELECT d.defs FROM d ...) 
  </code></pre>
  
  <p>On MSSQL this query executed (and failed) as:</p>
  
  <pre><code>....
  WHERE 
     ( 
     (kd.ITEM_ID, kd.DEF_ID) not in  (
         SELECT
            defs.ITEM_ID, defs.DEF_ID 
  </code></pre>
  
  <p>My <code>kd</code> entity has compound key of 2 fields ITEM_ID and DEF_ID. SQL Server fails because in comparison with Oracle doesn't supports compound <code>IN</code> predicate.</p>
  
  <p>Obviously that is a bug in mapping produced by Hibernate. My question is: How to configure/patch Hibernate to provide field-by-field comparison of enlisted sample?</p>