Joined: Tue Aug 16, 2005 7:53 pm Posts: 2
|
I'm having trouble mapping two components of the same type for one table. I have a mailing address and a shipping address that I want to map to type net.smartblast.model.Address. However, I get an error when I run hbm2java. The relevant portion of the mapping document is pasted below.
Hibernate version:
3.0.5
Mapping documents:
<component name="mailingAddress" class="net.smartblast.model.Address">
<property name="street1" column="CLIENT_MAILING_ADDRESS1" type="string"/>
<property name="street2" column="CLIENT_MAILING_ADDRESS2" type="string"/>
<property name="city" column="CLIENT_MAILING_CITY" type="string"/>
<property name="state" column="CLIENT_MAILING_STATE" type="string"/>
<property name="postalCode" column="CLIENT_MAILING_POSTAL_CODE" type="string"/>
</component>
<component name="shippingAddress" class="net.smartblast.model.Address">
<property name="street1" column="CLIENT_SHIPPING_ADDRESS1" type="string"/>
<property name="street2" column="CLIENT_SHIPPING_ADDRESS2" type="string"/>
<property name="city" column="CLIENT_SHIPPING_CITY" type="string"/>
<property name="state" column="CLIENT_SHIPPING_STATE" type="string"/>
<property name="postalCode" column="CLIENT_SHIPPING_POSTAL_CODE" type="string"/>
</component>
When I run a hibernate task to generate java code it tells me:
Component net.smartblast.model.Address found more than once!
Is this possible to do with hibernate? If anyone knows how to do this please let me know or point me in the right direction here. Thanks in advance.
|
|