-->
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: Can Hibernate update a persisted object's composite PK?
PostPosted: Mon Feb 07, 2005 12:17 pm 
Newbie

Joined: Fri Oct 03, 2003 8:44 am
Posts: 11
Hibernate version:
2.1.6

Name and version of the database you are using:
MSSQL 2000


My first question: can hibernate update a persisted object's composite primary key? i.e., I initially insert into the database my object, X, which has a composite PK of [model: ford, year: 2000]. I later decide it should [model: ford, year: 2001]. Can hibernate take care of this issue for me if both of these columns are mapped in the composite pk?

My second question: if the answer to the first question is "yes", then how do I do it? :)

And yes, I know that composite id's are typically bad - but the database schema canNOT change, so using a synthetic key is not possible.

Thanks a bunch,
Jon


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 07, 2005 4:56 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
id are immutable. But you can copy all the values in an other object

_________________
Emmanuel


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.