Hi everyone! :)
This is my mapping file as it is now:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Entities.Category, Entities" table="Categories">
<id name="Id" column="CategoryID" type="int" unsaved-value="0">
<generator class="identity" />
</id>
<property name="ParentId" column="ParentID" type="int"/>
<property name="Name" column="CategoryName" type="String" length="50"/>
<property name="CreateDate" type="DateTime"/>
<property name="LastUpdatedDate" type="DateTime"/>
</class>
</hibernate-mapping>
How should it be changed so ParentId has a relation to Id?
I have seen many examples with parent/child mappings but all of them has two tables and therefor also two classes.