Hello, i want to map a class with a reference of the same type,
like this:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="CircularTest"
namespace="CircularTest">
<class name ="A" table ="ATable">
<!-- Id -->
<id name ="Id" type ="Guid">
<generator class ="guid.comb"/>
</id>
<!-- Data -->
<property name ="Data"/>
<!-- Areference -->
<property name ="Areference" />
</class>
</hibernate-mapping>
Code:
namespace CircularTest
{
public class A
{
public virtual Guid Id { get; set; }
public virtual int Data { get; set; }
public virtual A Areference { get; set; }
}
}
and got the following exception:
Could not determine type for: CircularTest.A, CircularTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b742abd039f7ea9e, for columns: NHibernate.Mapping.Column(Areference)
How can I map this kind of relation?.
Thanks!