title: NHibernate ConventionModelMapper; What is the difference between IsRootEntity & IsEntity
body: <p>I'm playing around with Sharp Architecture Lite, which emphasizes convention over configuration, and trying to understand how the NHibernate <code>ConventionModelMapper</code> works.  Specifically, I can't tell the difference between the IsRootEntity &amp; IsEntity methods below (BTW, <code>Entity</code> is an abstract class that ships with Sharp Arch):</p>
  
  <pre><code>     internal static class Conventions
          {
          public static void WithConventions(this ConventionModelMapper mapper, Configuration configuration) {
                  Type baseEntityType = typeof(Entity);
  
                  mapper.IsEntity((type, declared) =&gt; IsEntity(type));
                  mapper.IsRootEntity((type, declared) =&gt; baseEntityType.Equals(type.BaseType));
  
          public static bool IsEntity(Type type) {
                  return typeof(Entity).IsAssignableFrom(type)
                         &amp;&amp; typeof(Entity) != type
                         &amp;&amp; !type.IsInterface;
              }
      }
  </code></pre>
  
  <p>I gather that the <code>IsEntity</code> method is used to tell NHibernate which classes are eligible for mapping/persistence to the DB.  However, I can't for the life of me figure out what the <code>IsRootEntity</code> method does. The documentation around <code>ConventionModelMapper</code> is woefully sparse.</p>