Hi,
I would like to, programatically at initialisation, be able to add additional <property /> tags to the <dynamic-component /> section in the following mapping.
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false">
<class name="Test.Bug, Test" table="bugs">
<id name="Id" column="id" type="Int64">
<generator class="sequence">
<param name="sequence">bugs_id_seq</param>
</generator>
</id>
<property name="Title" column="title" type="String" not-null="true" />
<property name="CreatedOn" column="createdon" type="DateTime" not-null="true" />
<property name="CreatedBy" column="createdby" type="Int64" not-null="true" />
<dynamic-component name="CustomData">
<property name="col_1" column="col_1" type="Int64" />
<property name="col_2" column="col_2" type="Int64" />
</dynamic-component>
</class>
</hibernate-mapping>
I have extensivly searched the forums and docs, and have found a couple of posts from people saying that had managed to do this, but no mention of how.
The docs also mention that "Runtime manipulation of the mapping document is also possible, using a DOM parser" - does this mean the file itself prior to it being parsed or the DOM model used by the configuration object?
In this url someone says they have managed it:
http://forum.hibernate.org/viewtopic.php?t=972395&highlight=dynamiccomponent
And I have also read a post from Ayende Rahien giving a very high level view of what to do, but can not find it now.
Any pointers in the right direction would be much appreciated. :)
Thanks
Chris