title: NHibernate QueryOver: How to join unrelated entities?
body: <p>I have the following query working which gets the results I want:</p>
  <pre><code>int associatedId = 123;
  
  MyObject alias = null;
  
  var subQuery = QueryOver.Of&lt;DatabaseView&gt;()
      .Where(view =&gt; view.AssociatedId == associatedId)
      .And(view =&gt; view.ObjectId == alias.ObjectId)
      .Select(view =&gt; view.ObjectId);
  
  var results = session.QueryOver&lt;MyObject&gt;(() =&gt; alias)
      .WithSubquery.WhereExists(subQuery)
      .List();
  </code></pre>
  <p>The <code>DatabaseView</code> has been mapped as an actual NHibernate entity (so I can use it with <code>QueryOver</code>), but it is not associated to <code>MyObject</code> in the HBM mappings.</p>
  <p>This query returns an <code>IList&lt;MyObject&gt;</code> using a <code>SELECT ... FROM MyObject WHERE EXISTS (subquery for DatabaseView here)</code>. How can I re-write this to return the same data but using a JOIN instead of sub query?</p>