title: nHibernate complex Query
body: <p>I have a problem querying using nHibernate.<br>
  I have the following entities:  </p>
  
  <pre><code>public class CostAmount  
  {  
      public virtual int Id {get;set;}  
      public virtual Year Year{get; set;}  
      public virtual Month Month{get; set;}  
  }  
  
  public class Year  
  {  
      public virtual int Id {get;set;}  
      public virtual string Code {get;set;}  
  }  
  
  public class Month  
  {  
      public virtual int Id {get;set;}  
      public virtual string Code {get;set;}  
  }  
  </code></pre>
  
  <p>I want to query using some sql like the following:  </p>
  
  <pre><code>select * from CostAmount ca  
  inner join Year y on ca.YearID = y.ID  
  inner join Month m on ca.MonthID = m.ID  
  where y.Code *100+m.Code between 9107 and 9207  
  </code></pre>
  
  <p>Can any one help me please.  </p>