|
<element> is used for a basic collection elements (e.g, String, int). I did not see any reason to use a UserType; if something custom is really needed, a CompositeUserType should be used instead because it allows you to define the properties.
As far as I can tell, <composite-element> would suffice, as in the following:
<hibernate-mapping package="org.hibernate.test.collection.set">
<class name="PersonInfoEntity" table="PersonInfo">
<id name="id" column="ID" type="long" />
<set name="Infos">
<key column="entity_id" />
<composite-element class="org.hibernate.test.collection.set.PersonInfo" >
<property name="height" column="height" not-null="true"/>
<property name="hairColor" column name="hair_color" not-null="false" />
</composite-element>
</set>
</class>
</hibernate-mapping>
|