-->
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: Repeated mapping in column for entity ...
PostPosted: Sun Jul 20, 2008 7:23 am 
Newbie

Joined: Fri Jul 18, 2008 7:45 am
Posts: 6
I have two tables
USER
{
userId
name
}

CUSTOMER
{
customerId
name
advisor (which is a fk of user)
boss (which is a fk of user)
}

which its corresponding POJO.

How can I map these relationships? I've tried:

<class name="User" table="USER">
<id
name="userId"
type="string"
column="userId"
length="9"
>
</id>
<property
name="name
type="string"
column="NAME
length="30"
/>
</class>
<class name="Customer" table="CUSTOMER">
<id
name="customerId"
type="string"
column="customerId"
length="20"
>
</id>
<property
name="name
type="string"
column="NAME
length="30"
/>
<many-to-one name="advisor" class="User" column="USERID"/>
<many-to-one name="boss" class="User" column="USERID"/>
</class>

but I receive the error:

Repeated column in mapping for entity: User column: USERID (should be mapped with insert="false" update="false")

And I want to update and insert new Customers adding boss and advisor info. Then I can't add the insert and update equals to false.

Thanks in advance.

Best regards,
Paco


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 21, 2008 11:45 am 
Newbie

Joined: Fri Jul 18, 2008 7:45 am
Posts: 6
Any idea, please?


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.