-->
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.  [ 4 posts ] 
Author Message
 Post subject: JPwH Errata: Page 409: confused about calling update() on
PostPosted: Sun Aug 12, 2007 5:27 am 
Newbie

Joined: Wed Aug 02, 2006 9:40 pm
Posts: 13
Location: China
9.3.2 Working with detached objects
first paragraph:
A detached instance may be reattached to a new Session (and managed by this new persistence context) by calling update() on the detached object.

should be

A detached instance may be reattached to a new Session (and managed by this new persistence context) by calling update() on the session object.


BTW: third paragraph:
Hibernate always treats the object as dirty and schedules an SQL UPDATE.,

should be

Hibernate always treats the object as dirty and schedules an SQL UPDATE,

_________________
http://YuLimin.JavaEye.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 12, 2007 6:24 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
No, you call update(object), on the object. The period problem in the third paragraph I added to the errata.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 12, 2007 8:05 am 
Newbie

Joined: Wed Aug 02, 2006 9:40 pm
Posts: 13
Location: China
very confused.

Do you mean to call detachedObject.update(detachedObject); to reattach it?

In fact, what it calls is session.update(detachedObject); to reattach it.

_________________
http://YuLimin.JavaEye.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 12, 2007 10:10 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You call session.update(object). The update() method works UPON the object.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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