title: NHibernate CreateCriteria not working correctly with association and dates
body: <p>I am trying to create an association to load a list of parent objects based on a child objects date field. I only want parent objects where the date is >= a given date.</p>
  
  <p>The problem is, when I use either today's date or the day before, it returns the correct children. But if I use a date further back in time, like 11-2-2010, it is including children that have a date &lt; 11-2-2010.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>public IList&lt;Parent&gt; GetByDate(string parentId, DateTime date) {
    IList&lt;Parent&gt; list = null;
    using (ISession session = SessionFactory.OpenSession()) {
      list = session.CreateCriteria(typeof(Parent))
                        .Add(Expression.Eq("parent_id", parentId))
                        .CreateCriteria("children")
                          .Add(Expression.Gt("end_date", date)).List&lt;Parent&gt;();
    }
    return list;
  } 
  </code></pre>
  
  <p>and the mapping for Parent:</p>
  
  <p></p>
  
  <pre><code>&lt;id name="id"&gt;
    &lt;generator class="native"/&gt;
  &lt;/id&gt;
  
  &lt;property name="parent_id" /&gt;
  
  &lt;bag name="children" lazy="false"&gt;
    &lt;key column="parent_id" /&gt;
    &lt;one-to-many class="Child" /&gt;
  &lt;/bag&gt;
  </code></pre>
  
  <p></p>
  
  <p>Thanks in advance!</p>