-->
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.  [ 3 posts ] 
Author Message
 Post subject: Over Writing an existing hibernate object.
PostPosted: Thu Apr 19, 2007 8:37 am 
Newbie

Joined: Tue Apr 03, 2007 8:17 am
Posts: 2
Location: Bangalore, India
hi!!,

I wanted to know if there is any method to over write an existing hibernate object with a new object.

I typically want to update the entries in a table. At this moment i am using the update clause.

For example:
I am reading elements from a html (jsp) form and storing them into a hibernate object. I now want to update the database table with these new entries. So instead of using the update clause is there any way in which i can get the old hibernate object from the table and just over write it with this new object.


Please let me know if i am not clear.

Regards ,

Chaitanya Deshpande


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 19, 2007 8:47 am 
Regular
Regular

Joined: Mon Mar 26, 2007 12:38 am
Posts: 119
not sure what you mean by overwrite.
Take a look at session.refresh() and session.merge()

----------------------------------------------------------
Rate the reply if you find it helpful


Top
 Profile  
 
 Post subject: Thank you
PostPosted: Tue Apr 24, 2007 6:11 am 
Newbie

Joined: Tue Apr 03, 2007 8:17 am
Posts: 2
Location: Bangalore, India
hi pramod,

Thank you so much. Sorry for replying so late. My problem is solved. I used

session.update(object);


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