Fluent NHibernate AutoMap

Posted by Markus on Stack Overflow See other posts from Stack Overflow or by Markus
Published on 2010-04-09T07:14:17Z Indexed on 2010/04/09 13:13 UTC
Read the original article Hit count: 235

Filed under:

Hi. I have a qouestion regarding the AutoMap xml generation. I have two classes:

public class User
{
  virtual public Guid Id { get; private set; }
  virtual public String Name { get; set; }
  virtual public String Email { get; set; }
  virtual public String Password { get; set; }
  virtual public IList<OpenID> OpenIDs { get; set; }
}



public class OpenID
{
    virtual public Guid Id { get; private set; }
    virtual public String Provider { get; set; }
    virtual public String Ticket { get; set; }
    virtual public User User { get; set; }
}

The generated sequences of xml files are: For User class:

<bag name="OpenIDs">
  <key>
    <column name="User_Id" />
  </key>
  <one-to-many class="BL_DAL.Entities.OpenID, BL_DAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</bag>

For OpenID class:
<many-to-one class="BL_DAL.Entities.User, BL_DAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="User">
  <column name="User_id" />
</many-to-one>

I don't see the inverse=true attribute for the User mapping. Is it a normal behavior, or I made a mistake somewhere?

© Stack Overflow or respective owner

Related posts about fluent-nhibernate