I'm attempting to implement <map> and IDictionary.
Here is an example mapping file:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"
assembly="TheBombShack.SpecialOps"
namespace="TheBombShack.SpecialOps"
>
<class name="PartCategory"
table="PartCategory">
<id name="ID" unsaved-value="0">
<generator class="native" />
</id>
<property name="CategoryName" length="100" />
<map name="Parts" table="categoryparts" inverse="true">
<key column="PartID"/>
<index-many-to-many class="Part" column="PartCategoryID"/>
</map>
</class>
</hibernate-mapping>
This throws an error stating:
Code:
The element 'map' in namespace 'urn:nhibernate-mapping-2.0' has incomplete content. List of possible elements expected: 'urn:nhibernate-mapping-2.0:element urn:nhibernate-mapping-2.0:one-to-many urn:nhibernate-mapping-2.0:many-to-many urn:nhibernate-mapping-2.0:composite-element urn:nhibernate-mapping-2.0:many-to-any'.
OK, odd... I had thought the documentation had said use index-many-to-many. So I tried changing the index-many-to-many to a many-to-many.
This throws an error stating:
Code:
The element 'map' in namespace 'urn:nhibernate-mapping-2.0' has invalid child element 'many-to-many' in namespace 'urn:nhibernate-mapping-2.0'. List of possible elements expected: 'urn:nhibernate-mapping-2.0:index urn:nhibernate-mapping-2.0:composite-index urn:nhibernate-mapping-2.0:index-many-to-many urn:nhibernate-mapping-2.0:index-many-to-any'.
So when I put in index-many-to-many I get told to put in many-to-many and vice versa.
Any suggestions on getting around this?
Thanks