title: Fluent NHibernate one to many am i doing it right?
body: <p>Have Books class. </p>
  
  <pre><code>public class Books
  {
  
      public virtual int Id { get; set; }
      public virtual string Title { get; set; }
  
      public virtual string Category { get; set; }
  
      public virtual string ISBN { get; set; }
  
      public virtual string Description { get; set; }
  
      public virtual string Image { get; set; }
  
      public virtual int CategoryId { get; set; }
  
      public Categories Categories { get; set; }
  
      public virtual IList&lt;Comments&gt; Comments { get; set; }
  
      public Books()
      {
          Comments = new List&lt;Comments&gt;();
      }
  
  }
  </code></pre>
  
  <p>Also Comments Class.</p>
  
  <pre><code>public class Comments    
  {
      public virtual int Id { get; set; }
  
      public virtual string CommentText { get; set; }
  
      public virtual DateTime Date { get; set; }
  
      public virtual int IdBook { get; set; }
  
      public Books Books { get; set; }
  }
  </code></pre>
  
  <p>My map code for Books class : </p>
  
  <pre><code>public class BooksMap : ClassMap &lt;Books&gt;
  {
      public BooksMap()
      {
          Id(x =&gt; x.Id);
          Map(x =&gt; x.Title);
          Map(x =&gt; x.ISBN);
          Map(x =&gt; x.Description);
          Map(x =&gt; x.Category);
          Map(x =&gt; x.Image);
          Map(x =&gt; x.CategoryId);
          //reference to categories
          References(x =&gt; x.Categories).Column("Id").Not.Nullable();
          //inverse reference (hasmany comments, rating)
          HasMany(x =&gt; x.Comments).Cascade.All().Inverse();
      }
  }
  </code></pre>
  
  <p>Also Comments map > </p>
  
  <pre><code>public class CommentsMap:ClassMap&lt;Comments&gt;
  {
      public CommentsMap()
      {
          Id(x =&gt; x.Id);
          Map(x =&gt; x.CommentText);
          Map(x =&gt; x.Date);
          Map(x =&gt; x.IdBook);
          References(x =&gt; x.Books).Column("Id").Not.Nullable();
      }
  }
  </code></pre>
  
  <p>My question is : am I doing it right? - and how to make queries with this mapings for example criteria language?</p>