I've have started my foray into C#.NET and NHibernate and I'm finally stuck on an exception I can't seem to figure out, and Google isn't helping.
I'm getting a NHibernate.DuplicateMappingException : Duplicate class/entity mapping on my Parent class. Below is my mapping file for the Parent class, and the Youth class that uses the Parent class:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Surrix.Cerberus.YouthData"
namespace="Surrix.Cerberus.YouthData.Domain">
<class name="Parent">
<id name="parentId">
<generator class="guid" />
</id>
<property name="firstName" not-null="true" />
<property name="lastName" not-null="true" />
<property name="homePhone" />
<property name="parentEmail" />
<property name="relationshipToYouth" />
<!-- Address component that should map to the Address class -->
<component name="parentAddress">
<property name="street" />
<property name="state" />
<property name="zipCode" />
<property name="city" />
</component>
</class>
</hibernate-mapping>
And here is the relevant parts of the Youth class (it is considerably bigger)
<set name="YouthParents" table="YouthParents" cascade="none">
<key column="youthId" />
<many-to-many column="parentId" class="Parent"/>
</set>
Only other thing is the Youth class also has the firstName and lastName properties, but I can't see that being a problem.