-->
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: update(Object,Serializable)
PostPosted: Tue Oct 14, 2003 11:13 pm 
Regular
Regular

Joined: Tue Oct 14, 2003 11:11 pm
Posts: 62
Location: Brasil/Curitiba
Hi,

What

_________________
Ricardo Lecheta


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 12:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The first is updating the instance. All the data including the id (eg not null) is included with the instance. This instance is placed into the session cache. The second updates the data using using the supplied id thus the objects id, if it has one, is not important. If you view the code the first calls the second so the API to select depends on the circumstances you find you are in. For example, you don't have the access methods for the id on the class object. This is possible but not recommended.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 15, 2003 8:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Hibernate doesn't require an identifier property. So you should use the second form if there is no identifier property. However, I very strongly suggest that you use identifier properties everywhere.


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.