Hello,
I have a component 'Value' which has the following
properties :
- amount
- quantity (length, mass, time, etc.)
- dimension (m, kg, sec, etc.)
I use this Value in multiple classes and sometimes I use
multiple Values in one class.
I would like to make Value a 'component'.
But according to the hibernat-mapping-dtd a 'component' can
only be declared inside a 'class'-element. That means that I
have to declare it x-times.
It would be nice if I could declare it on the same level as
the class-element and than make a reference to it.
As I sometimes use multiple 'Values' in one class I could also
have use to prefix a property-name.
Something like this:
Code:
<hibernate-mapping>
<class name="Article">
<component name="intakeSpeed" type="Value" prefix="intakeSpeed"/>
<component name="maxTemperature" type="Value" prefix="maxTemp"/>
</class>
<component name="Value">
<property name="amount"/>
<property name="quantity"/>
<property name="dimension"/>
</component>
</hibernate-mapping>
This would create in the database the following columns :
intakeSpeed_amount, intakeSpeed_quantity, intakeSpeed_dimension,
maxTemp_amount, maxTemp_quantity and maxTemp_dimension.
Any thoughts on this ?
Kees Kuip.[/code]