Hi all, I want to map the graph - nodes, that are connected with edges.
Suppose that we have such model:
Code:
public class Node
{
public virtual Guid Id { get; set; }
}
public class Edge
{
public virtual Guid Id { get; set; }
public virtual Node StartNode { get; set; }
public virtual Node EndNode { get; set; }
}
Mapping:
Code:
<class name="Node">
<id name="Id">
<column name="Id" not-null="true"/>
<generator class="guid"/>
</id>
</class>
<class name="Edge">
<id name="Id">
<column name="Id" not-null="true"/>
<generator class="guid"/>
</id>
<property name="StartNode" type="EnkiStudio.Model.Node, EnkiStudio"/>
<property name="EndNode"/>
</class>
But I have mapping exception:
NHibernate.MappingException: Could not determine type for: EnkiStudio.Model.Node, EnkiStudio, for columns: NHibernate.Mapping.Column(StartNode)
How to map StartNode and EndNode to have edges table with foreign keys and cascaded edit operations?