-->
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: Session.update() method
PostPosted: Fri Nov 26, 2010 2:41 am 
Newbie

Joined: Fri Nov 26, 2010 2:32 am
Posts: 3
I read javadoc for session.update() method which said;
It update the persistent instance with the identifier of the given detached instance. If there is a persistent instance with the same identifier, an exception is thrown. This operation cascades to associated instances if the association is mapped with cascade="save-update".

I didn't get the meaning of statement that says; "if there is a persistent instance with the same identifier, an exception is thrown".

Also update method syntax is public void update(Object object)
Here we don't pass the Id information to update method so as to determine exactly which record we need to update, thus how does hibernate knows which record to update in database?


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.