Thanks for the info pasha.
I have implemented it so there is a java class backing the data with some 'fixed' properties and a custom properties map...
Code:
public class Person {
// Instance properties
protected Long id;
protected String foreNames;
protected String surname;
protected String title;
protected Map customProperties;
// Instance methods.... get, set etc.
}
and in the mapping document...
Code:
<class name="Person" table="PEOPLE">
<id name="id" column="id">
<generator class="native" />
</id>
<property name="title" />
<property name="foreNames" />
<property name="surname" />
<dynamic-component name="customProperties">
<property name="gender" type="string" />
<property name="age" type="integer" />
</dynamic-component>
</class>
If a user wishes to record another field for a Person, then the application simply adds another property element to the dynamic-component element of that class in the mapping document, and hibernate creates the relevant columns in the database.