code: public void bindClass(PersistentEntity entity, InFlightMetadataCollector mappings, String sessionFactoryBeanName)
              throws MappingException {
          //if (domainClass.getClazz().getSuperclass() == Object.class) {
          if (entity.isRoot()) {
              bindRoot((HibernatePersistentEntity) entity, mappings, sessionFactoryBeanName);
          }
      }
docs: Binds a Grails domain class to the Hibernate runtime meta model
  
  @param entity The domain class to bind
  @param mappings    The existing mappings
  @param sessionFactoryBeanName  the session factory bean name
  @throws MappingException Thrown if the domain class uses inheritance which is not supported