title: Nhibernate Queryover subquery and whereexists with 2 conditions
body: <p>Consider the following object structure.</p>
  
  <pre><code>Product
  id : int
  name : string
  attribute : list of Attribute
  
  Attribute
  id : int
  name: string
  value : string
  product_id : int
  </code></pre>
  
  <p>The questions is:
  Using QueryOver how to form a subquery to return all products
  with the following conditions:</p>
  
  <p>Select all products where when have attributes at the same time:</p>
  
  <p>Attribute name = "Color" Value="Red"
  and
  Attribute name = "Size" Value="XXL" ?</p>
  
  <p><em>Edit:</em> Sample sql:</p>
  
  <pre><code>select * from Product p where
  exists (select id from attribute where name = 'Color' and value = 'Red' and product_id = p.id)
  and
  exists (select id from attribute where name = 'Size' and value = 'XXL' and product_id = p.id)
  </code></pre>