title: Unable to resolve property: Id
body: <p>I'm getting the following error message:</p>
  
  <pre><code>NHibernate.HibernateException: NHibernate.HibernateException: Unable to resolve property: Id.
  </code></pre>
  
  <p>This error is thrown from the following line of code:  </p>
  
  <pre><code>User userFound = session.QueryOver&lt;User&gt;()
                     .Where(x =&gt; x.Id == testObjects.TestUser.Id)
                     .SingleOrDefault();
  </code></pre>
  
  <p>My abbreviated mappings are as follows:  </p>
  
  <pre><code>public class UserMap : ClassMap&lt;User&gt;
  {
      public UserMap()
      {
          Table("USER_HEADER");
          Id(x =&gt; x.Id, "USER_ID")
              .GeneratedBy.Foreign("UserLocation");
  
          HasOne(x =&gt; x.UserLocation)
              .PropertyRef(x =&gt; x.Id)
              .Cascade.All();
      }
  }
  
  public class LocationMap : ClassMap&lt;Location&gt;
  {
      public LocationMap()
      {
          Table("LOC_HEADER");
          Id(x =&gt; x.Id, "LOC_ID");
  
          HasOne(x =&gt; x.User)
              .PropertyRef(x =&gt; x.Id);
      }
  }
  </code></pre>
  
  <p>I was able to query a User object before I added this relationship to <code>Location</code> so I know it has something to do with it but I'm not sure what exactly.  I can successfully create a <code>User</code> object that is tied to a <code>Location</code> but cannot query it.  Using <code>ISession.Get</code> produces the same error as the above QueryOver statement.</p>
  
  <p>Below is the overall unit test I am running that is failing:</p>
  
  <pre><code>    public void Can_Create_User()
      {
          using (NHibernate.ISession session = SessionFactory.GetCurrentSession())
          {
              using (NHibernate.ITransaction tran = session.BeginTransaction())
              {
                  session.Save(testObjects.TestValidationDetail);
                  session.Save(testObjects.TestUser);
                  tran.Commit();
              }
          }
  
          using (NHibernate.ISession session = SessionFactory.GetCurrentSession())
          {
              User userFound = session.QueryOver&lt;User&gt;().Where(x =&gt; x.Id == testObjects.TestUser.Id).SingleOrDefault();
  
              Assert.IsNotNull(userFound);
              Assert.AreEqual(userFound.Id, userFound.UserLocation.Id);
          }
      }
  </code></pre>