I'm running into an issue using <map /> with <one-to-many />. I'm not
clear if this is a bug or intended behavior. When I have a mapping as
such:...
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping assembly="NHMapTest" namespace="NHMapTest"
xmlns="urn:nhibernate-mapping-2.2">
<class name="Child" table="Child" >
<id name="Id" generator="native" />
<many-to-one name="Parent" column="ParentId"/>
</class>
<class name="Parent" table="Parent" >
<id name="Id" generator="native" />
<map name="Children" inverse="true" cascade="all">
<key column="ParentId" />
<index column="Name" type="string" />
<one-to-many class="Child" />
</map>
</class>
</hibernate-mapping>
The index column "Name" is inserted as null. However I can map that column
on Child, and set the value of Name, it works correctly. as such...
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping assembly="NHMapTest" namespace="NHMapTest"
xmlns="urn:nhibernate-mapping-2.2">
<class name="Child" table="Child" >
<id name="Id" generator="native" />
<property name="Name" />
<many-to-one name="Parent" column="ParentId"/>
</class>
<class name="Parent" table="Parent" >
<id name="Id" generator="native" />
<map name="Children" inverse="true" cascade="all">
<key column="ParentId" />
<index column="Name" type="string" />
<one-to-many class="Child" />
</map>
</class>
</hibernate-mapping>
Is this intended behavior? Either way I'll work up a bug in jira and
pull-request over the holidays.
--
---
You received this message because you are subscribed to the Google Groups
"nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.