I have defined a custom user type that works fine when used properties of my entities. For instance:
<class name="com.my.sample" table="MY_TABLE">
...
<property name="foo" type="myCustomUserType">
</class>
I’m needing something like this:
<class name="com.my.sample" table="MY_OTHER">
...
<component name="myAddress" class="com.my.sample.Address">
<property name="street" column="MY_OTHER_ADRR_STREET" />
<property name="foo" type="myCustomUserType" column="MY_OTHER_ADRR_COLUMN" />
</component>
</class>
Obviously, I’m supposing that myCustomUserType is properly defined in the .HBM file. Is it possible to map a <component> property like this?
Actually, it works fine. It is also possible to map
<component>properties using relationships such as<many-to-one>. The mapping was somethig like this:Unfortunatelly, the Hibernate documentation is not very obvious about this.