Thanks for your help, but Im not sure that the above code will work for the structure I have.
I have a Job table and a jobDependency table as follows
Job - JobID, Status,Description
Job Dependency - ParentJobID,ChildJobID
Jobs can have multiple parents and multiple children, so the table is normalized into the dependency table which just holds all id->id mappings.
Currently i have the following in my mapping file...
Code:
<class name="Job" table="Job">
<id name="Id" column="Id" type="Int32" unsaved-value="0">
<generator class="native"/>
</id>
<property column="Status" type="Int32" name="Status" not-null="true" />
<set name="ChildTasks" table="TaskDependency" lazy="false" inverse="true" cascade ="all" access="NHibernate.Generics.GenericAccessor, NHibernate.Generics">
<key column="Id"/>
<one-to-many column="ParentTaskId" class="Job" />
</set>
<many-to-one name="ParentTaskId" column="ChildTaskId" class="Job" />
</class>
I'm trying to set up a list map in the usual way only referring it to itself. This is resulting in a MappingException "The 'column' attribute is not declared" and i cant figure it out...