Hi!
Chapter 8.5
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#components-dynamicin hibernate documentation about dynamic-component says:
Quote:
Runtime manipulation of the mapping document is also possible, using a DOM parser. Even better, you can access (and change) Hibernate's configuration-time metamodel via the Configuration object.
Is there an example or a more detailed explanation of the runtime manipulation?
How can i manipulate the Configuration object at runtime so that i can
add a new column/property to a dynamic-component?
Hibernate version: 3.2.4 SP1
Mapping documents:
<hibernate-mapping>
<class name="sample.DynamicFieldCollection" table="DynamicFieldCollection">
<id name="id" column="Id" type="string">
<generator class="uuid.hex"/>
</id>
<one-to-one name="employee" class="sample.SampleEmployee"/>
<dynamic-component name="dynamicFields">
<property name="field_1" type="string" column="field_1"/>
</dynamic-component>
</class>
<class name="sample.SampleEmployee" table="Employee">
<id name="id" column="Id">
<generator class="uuid.hex"/>
</id>
<property name="title" column="Name"/>
</class>
</hibernate-mapping>
thomas