Automatically compose column-names for usertypes

Description

I would like to generate column-names for user-types.

For example if I have the userType Value have the following maping

<property name="deliveredAmount" type="my.customtype.ValueUserType">
<column name="deliverdAmountValue">
<column name="deliverdAmountUnitOfMeasure">
</property>

For every time I use my UserType I have to define the columns of the property when my usertype has more than one column.
I would like to generate the column-names automatically:

So I supplied a patch where a UserType can implement an Interface which will supply the column name extensions for the usertype.
So the extensions are "Value" and "UnitOfMeasure" for the above example. Now hibernate can compose the column-name from the property-name and the extensions.

If there are column supplied in the mapping, then we use them instead of the extensions. ( See the patch )

Is this a good solution ?
Do you now a better alternative ?
Could you apply this patch ?

To run this patch go to the hibernate-3.1 directory.

patch --binary -p1 < extensionsColumns.patch

I applied the --binary parameter to prevent CR/LF problems.

Environment

Hibernate 3.1 rc3
mysql

Attachments

Assignee

Unassigned

Reporter

Sjoerd Takken

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure