-->
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 column in mapping
PostPosted: Fri Jan 09, 2009 1:07 pm 
Newbie

Joined: Fri Jan 11, 2008 5:50 am
Posts: 9
Hello,

I am trying to define a parent/child relationship where the Primary Key of the parent entity is part of the Primary Key of the Child Entity. I have defined the child entity as follows:

Code:
<hibernate-mapping>

  <class name="PropertyValueItem" table="property_value_item">
 
     <composite-id name="id" class="PropertyValueItem$Id">
       <key-property name="key"
                     access="field"
                     column="pv_list_key" />
       <key-property name="value"
                     access="field"
                     column="value" />
     </composite-id>
     
     <property name="description" column="description" />
     <property name="order" column="value_order" type="int" />
 
     <many-to-one name="propertyValue"
                 class="PropertyValue"
                 column="pv_list_key"
                 not-null="true"
                 fetch="select"
                 insert="false"
                 update="false" />
 
  </class>
 
</hibernate-mapping>


However when I go to execute my program I get the following error:

Quote:
Repeated column in mapping for entity: PropertyValueItem column: pv_list_key (should be mapped with insert="false" update="false")


What am I doing wrong? I have defined insert and update to be false

Many Thanks

Andy[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 10, 2009 10:38 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
Try key-many-to-one as shown here:

http://www.hibernate.org/hib_docs/refer ... ompositeid

_________________
Chris Bredesen
Senior Software Maintenance Engineer, JBoss


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.