-->
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.  [ 1 post ] 
Author Message
 Post subject: ManyToOne relationship and Property using same column
PostPosted: Mon Jan 18, 2010 12:39 am 
Newbie

Joined: Sun Mar 22, 2009 5:20 am
Posts: 6
Im working with a legacy database and an application written for Apple WebObjects and migrating it to Hibernate.

I'm trying to map a many to one relationship and its join column as a property. But Hibernate gives "Repeated column in mapping" error if i try to do that, unless i make one of them readonly with insert=false and update=false.

But the application written in WebObjects requires both to be writable. Is there any way around this?

Example:

<class name="Student" table="students">

<property name="deptCode" column="dept_code" type="string">

<many-to-one name="department" class="Department">
<column name="dept_code"/>
</many-to-one>

</class>


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

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.