Hi,
I have mapped a User entity containing an Address, mapped as a UserType instead of a component (what you would normally do).
Code:
<class name="User" table="Entity" >
<id .../>
<property name="address" type="AddresUserType">
<column name="street"/>
<column name="city"/>
</property>
...
</class>
The AddressUserType implements CompositeUserType. This works just fine.
However, now I want to add a collection of telephone nr's inside the Address class. Something like the following although the following mapping is just not possible of course.
Code:
<class name="User" table="Entity" >
<id .../>
<property name="address" type="AddresUserType">
<column name="street"/>
<column name="city"/>
<set name="telephonenrs">
...
</set>
</property>
...
</class>
How can I map this, still using the UserType?
In the nullSafeGet and nullSafeSet of the AddressUserType I need to get the collection of telephone nr's linked to that Address/User. What's the best way to do this and does a similar example exist?
Thanks
Jan