-->
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: Update a column that is a member of a compound primary key
PostPosted: Tue Jun 16, 2009 1:48 pm 
Newbie

Joined: Tue Jun 16, 2009 1:44 pm
Posts: 2
I have a 3 column primary key, ITEM_ID, END_DATE and MEMBER_ITEM_ID. This table contains membership information that is historical, is there a way to update the END_DATE when a member is removed. Currently updating the END_DATE and persisting the entity results in another record added to the table. Is there a way to update a column that is a member of a compound primary key?


Top
 Profile  
 
 Post subject: Re: Update a column that is a member of a compound primary key
PostPosted: Tue Jun 16, 2009 2:11 pm 
Newbie

Joined: Tue Jun 16, 2009 1:44 pm
Posts: 2
Nevermind, figured out a work around. I do a entityManager.remove on the entity and the update the END_DATE and then insert the new entity.


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.