title: NHibernate Mapping Exception: An association from the table dbo.AccountGroup refers to an unmapped class: System.String
body: <p>I am getting this error:</p>
  
  <p>An association from the table dbo.AccountGroup refers to an unmapped class: System.String</p>
  
  <p>This is my entity:</p>
  
  <pre><code>public class AccountGroup
  {
      public virtual int Id { get; private set; }
      public virtual string Name { get; set; }
      public virtual string Parent { get; set; }
      public virtual string Description { get; set; }
      public virtual IList&lt;Account&gt; Accounts { get; set; }
  
      public AccountGroup()
      {
          this.Accounts = new List&lt;Account&gt;();
      }
  }
  
  public class Account
  {
      public virtual int Id { get; private set; }
      public virtual string Code { get; set; }
      public virtual string Name { get; set; }
      public virtual string Description { get; set; }
      public virtual int Category { get; set; }
      public virtual AccountGroup Group { get; set; }
      public virtual IList&lt;LedgerEntry&gt; LedgerEntries { get; set; }
  
      public Account()
      {
          this.LedgerEntries = new List&lt;LedgerEntry&gt;();
      }
  }
  </code></pre>
  
  <p>This is my mapping:</p>
  
  <pre><code>    public AccountGroupMap()
      {
          Table("dbo.AccountGroup");
          Id(x =&gt; x.Id)
              .Column("Id");
          Map(x =&gt; x.Name);
          References(x =&gt; x.Parent)
              .Column("Parent");
          Map(x =&gt; x.Description);
          HasMany(x =&gt; x.Accounts)
              .KeyColumn("GroupId")
              .Inverse()
              .Cascade.All();
      }
  }
  
      public AccountMap()
      {
          Table("dbo.Account");
          Id(x =&gt; x.Id)
              .Column("Id");
          Map(x =&gt; x.Code);
          Map(x =&gt; x.Name);
          Map(x =&gt; x.Description);
          Map(x =&gt; x.Category);
          References(x =&gt; x.Group)
              .Column("AccountGroupId");
          HasMany(x =&gt; x.LedgerEntries)
              .KeyColumn("AccountId")
              .Inverse()
              .Cascade.All();
      }
  </code></pre>
  
  <p>Here are my tables:</p>
  
  <p>CREATE TABLE AccountGroup
  (
      Id int PRIMARY KEY,
      Name varchar(20),
      Parent int,
      Description varchar(20)
  )</p>
  
  <p>CREATE TABLE Account
  (
      Id int PRIMARY KEY,
      Code varchar(30),
      Name varchar(20),
      Description varchar(20),
      Category int,
      AccountGroupId int,
      FOREIGN KEY (AccountGroupId) REFERENCES AccountGroup (Id)
  )</p>