-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Mapping two components of the same type
PostPosted: Tue Aug 16, 2005 8:06 pm 
Newbie

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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 8:11 pm 
Newbie

Joined: Tue Aug 16, 2005 7:53 pm
Posts: 2
I posted this in the wrong portion of the forum... sorry about that... this should go under users.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.