title: NHibernate QueryOver value collection
body: <p>I have a project using NH 3.1 and have been using the QueryOver syntax for everything thus far.</p>
  
  <p>One aspect of this project lives in a organization-wide database that I have read-only access to and is using a completely differently DBMS (Oracle vs MSSQL). So I store references from my objects (Foos) to their objects (Bars) using a standard many-to-many table </p>
  
  <pre><code>FooBars
  FooID int not null PK
  BarID int not null PK
  </code></pre>
  
  <p>And my domain object, instead of having a <code>Iset&lt;Bar&gt;</code> instead has an <code>ISet&lt;int&gt; BarIDs</code> which is manually mapped to the <code>FooBars</code> table. This prevents NH from trying to do the impossible and join all the way over to the Bars table (I can use a BarRepository.Get() to retrieve the details of the Bars later, if I need them, and in this case, I wouldn't, because I just need the IDs to filter the list of objects returned).</p>
  
  <p>Given <code>IList&lt;int&gt; SelectedBars</code> how can I write a <code>QueryOver&lt;Foo&gt;</code> where <code>BarIDs</code> contains any element in <code>SelectedBars</code>?</p>
  
  <p>SQL something like </p>
  
  <pre><code>...FROM foos INNER JOIN foobars on foo.fooID = foobars.fooID WHERE barID IN ( ... )
  </code></pre>