A bit of a bump for this topic. Hopefully if I add some code somebody might be able to help a little. So...
Here's the XML I want to map...
Code:
<customerconfig>
<site name="Page Title" collection="abc123">
<rule><![CDATA[]]></rule>
<rule><![CDATA[]]></rule>
<rule><![CDATA[]]></rule>
<rule><![CDATA[]]></rule>
</site>
</customerconfig>
And here are the XML mapping files I would like to map it to:
Code:
<hibernate-mapping>
<class name="SiteCollection" table="site_collection" node="site">
<id name="id" column="site_collection_id" node="@collection">
<generator class="assigned"/>
</id>
<property name="name" node="@name"/>
<set name="ruleset" table="ruleset">
<key column="site_collection_id"/>
<many-to-many column="rule_id" class="Rule"/>
</set>
</class>
</hibernate-mapping>
Code:
<hibernate-mapping>
<class name="Rule" table="rule">
<id name="id" column="rule_id">
<generator class="native"/>
</id>
<property name="script" node="rule"/>
<set name="ruleset" table="ruleset" inverse="true">
<key column="rule_id"/>
<many-to-many column="site_collection_id" class="SiteCollection"/>
</set>
</class>
</hibernate-mapping>
I have managed to do the map the regular properties correctly and that is fine but I have no idea how I would be able to map the XML to my associations.
Is it possible to do with a simple node attribute or would I need to code this?