title: Converting SQL Query to NHibernate
body: <p>I have a SQL Query and i am trying to convert it into Nhibernate query and run it.</p>
  
  <p>SQL Query </p>
  
  <pre><code>SELECT 
      A.*
  FROM 
      TestTable i
  LEFT JOIN 
      TestTable o
  ON 
      i.testColumn=o.testcolumn and i.testColumn1='TestColumn1'       
  WHERE      o.StartDate &lt;= '2016-10-28' and i.testColumn2 &gt; 3
  </code></pre>
  
  <p>Nhibertnate Query</p>
  
  <p>ObjectA is a C# object version of TestTable </p>
  
  <pre><code> ObjectA o = null;
   ObjectA i = null;
  
   var query = Session.QueryOver(() =&gt; o)
              .Left.JoinQueryOver(() =&gt; i)
              .Where(() =&gt; o.testColumn == i.testColumn)
              .Where(() =&gt; i.testColumn1 == "TestColumn1")
              .Where(() =&gt; i.testColumn2 == 3
              .Where(() =&gt; o.StartDate &lt;= '2016-10-28')
                        return query.Take(100).List();
  </code></pre>
  
  <p>Mappings</p>
  
  <pre><code>  public ObjectATableMap : ClassMap&lt;ObjectA&gt;
      {
          Schema("[Test]");
          Table("[TestTable]");
  
          Id(x  =&gt; x.Id, "Id").GeneratedBy.Native();
          Map(x =&gt; x.TestColumn1, "TestColumn1");
       Map(x =&gt; x.TestColumn2, "TestColumn2");
       Map(x =&gt; x.StartDate ,"StartDate");
  
         }
  </code></pre>
  
  <p>When i run the above query i get the following message
  "could not resolve property: i of: ObjectA"
  Could anyone please provide me with the right hibernate Query.
  Thanks</p>