-->
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: Hibernate save or update is not working fine
PostPosted: Thu Dec 27, 2012 5:53 am 
Newbie

Joined: Wed Dec 26, 2012 6:28 am
Posts: 3
I have problem to utilize saveOrUpdate() method,

i have table user which is having columns name, address and id which is generated by hibernate Auto.

i wanna save first

(Mohan, BTM) == in DB (1, Mohan, BTM) it's working fine

i wanna update the same record in DB(1, Mohan, EC).

Instead of saving like this save or update method is creating one more row like

2 , mohan, EC.

Plz clarify my doubt .


Top
 Profile  
 
 Post subject: Re: Hibernate save or update is not working fine
PostPosted: Fri Dec 28, 2012 2:54 am 
Newbie

Joined: Thu Jul 15, 2010 11:20 am
Posts: 2
'saveOrUpdate() ' method create a new row when ID field of object is null.

Please check id field value before caling 'saveOrUpdate() ' method. In case ID field is blank set appropriate id value in it.


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.