-->
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: What different between session.save and session.persist() ?
PostPosted: Mon Aug 07, 2006 1:57 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Hi :

I find that there is a session.persist() method in hibernate3 document. The doc says the persist is save an object to database. But what different between session.persist() and session.save() ? Thks

_________________
You are not alone...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 4:05 am 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
as far as I know, save() is also used when you wish to get an identifier for your newly created object. Also, note that cascade operations differ between save and persist (for persist, only the 'persist' cascade operator can be used).


Top
 Profile  
 
 Post subject: :(
PostPosted: Mon Aug 07, 2006 7:06 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
sagimann wrote:
as far as I know, save() is also used when you wish to get an identifier for your newly created object. Also, note that cascade operations differ between save and persist (for persist, only the 'persist' cascade operator can be used).


So I think the "persist" method is not useful. But why hibernate have this method? Maybe it should be deleted from Hibernate API ?

_________________
You are not alone...


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.