I have failed so far to get the prefix attribute of the @hibernate.component tag to make any difference whatsoever and I was wondering whether anyone else was using it. My situation is that I have a Location class with two Latitude fields, differentiated by the following prefixes:
* @hibernate.component prefix="lat1" class="testing.om.geography.Latitude"
* @hibernate.component prefix="lat2" class="testing.om.geography.Latitude"
When the mapping files are generated, the prefix is not used and instead the mapping file ends up with these two tags:
<component
name="latitude1"
class="testing.om.geography.Latitude">
<property
name="decimalValue"
type="double"
update="true"
insert="true"
access="property"
column="value" />
</component>
<component
name="latitude2"
class="testing.om.geography.Latitude">
<property
name="decimalValue"
type="double"
update="true"
insert="true"
access="property"
column="value" />
</component>
The column name used is the one set in the tag in the Latitude class:
/**
* @hibernate.property column="value" type="double"
*/
public double getDecimalValue(){
return decimalValue;
}
Unsurprisingly the second component tag effectively overwrites the first, leaving a single 'value' column. The prefix is completely ignored.
I know prefix is a reasonably recent addition, and I was wondering whether it was working yet. I'm using the 1.2.2 version of the XDoclet module, and Hibernate 2.1.7c.
|