-->
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.  [ 5 posts ] 
Author Message
 Post subject: Can we Update Primary Key in Hibernate
PostPosted: Fri Mar 04, 2005 8:46 am 
Beginner
Beginner

Joined: Thu Feb 24, 2005 8:27 am
Posts: 21
I am having one question that Can we Update Primary Key in Hibernate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 04, 2005 8:52 am 
Newbie

Joined: Mon Feb 28, 2005 12:53 pm
Posts: 18
No. You can delete the object with a primary key and insert a new created one.


Top
 Profile  
 
 Post subject: So is there any way to change the Primary key in Hibernate
PostPosted: Fri Mar 04, 2005 9:04 am 
Beginner
Beginner

Joined: Thu Feb 24, 2005 8:27 am
Posts: 21
So is there any way to change the Primary key in Hibernate
Please Help me out.


Top
 Profile  
 
 Post subject: Please Can Anybody tell me
PostPosted: Fri Mar 04, 2005 9:21 am 
Beginner
Beginner

Joined: Thu Feb 24, 2005 8:27 am
Posts: 21
Please give me suggestion on how can i update my primary key.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 07, 2005 10:10 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
No you can't using Hibernate. Read the section on object identity in the Hibernate in action book.

You need to be asking yourself why you want to update the primary key. Have you mapped the primary key to a key with business meaning that is mutable?

If you absolutely have to change the primary key use JDBC and make sure that you clear the cache if you have a session open.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.