title: Querying on Collection with Nhibernate Criteria Api?
body: <p>I have an "Estate" entity, and this entity has a collection "EstateFeatures"(type:EstateFeature) and EstateFeature has a property "MyFeatureValue".</p>
  
  <p><em>Note: These are the limited properties for the question. All Entities has an Id and all necesarry etc</em></p>
  
  <p><strong>Estate</strong> </p>
  
  <pre><code>IList&lt;EstateFeature&gt; EstateFeatures;
  </code></pre>
  
  <p><strong>EstateFeature</strong></p>
  
  <pre><code>FeatureValue MyFeatureValue;
  </code></pre>
  
  <p><strong>FeatureValue</strong></p>
  
  <pre><code>public virtual long Id;
  </code></pre>
  
  <p>I am trying to get Real Estates which have the given FeatureValue.Id</p>
  
  <pre><code>DetachedCriteria query = DetachedCriteria.For&lt;Estate&gt;();
  Conjunction and = new Conjuction();
  foreach (var id in idCollection)
     and.Add(Expression.Eq("MyFeatureValue.Id",id);
  
  query
       .CreateCriteria("EstateFeatures")
       .Add(and);
  IList&lt;Estate&gt; estates = query.GetExecutableCriteria(session).List&lt;Estate&gt;();
  </code></pre>
  
  <p>Nothing returned from this query, am i doing something wrong ?</p>
  
  <p>Thanks</p>