-->
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: errata page 334 ?
PostPosted: Fri Dec 17, 2004 6:52 pm 
Newbie

Joined: Sat Nov 20, 2004 10:16 pm
Posts: 8
Location: Canada
Hi there,

I think the first code block has an error (page 334):

session.load(User.class, user);

should be

User user2 = (User) session.load(User.class, user);
or
user = (User) session.load(User.class, user);

I'm not sure about this though, because the way it is written in the book makes you think that 'user' gets populated by session.load (there is a comment above that line that says 'Load persistent state into user'

However, i tried to make it work that way and 'user' only had the two values for the composite key as a result of calling session.load. the other attributes were not retrieved from the DB. It worked when I did the modification specified above.

Thanks

Juan


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 18, 2004 2:31 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Added to errata, but different solution.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 18, 2004 4:52 pm 
Newbie

Joined: Sat Nov 20, 2004 10:16 pm
Posts: 8
Location: Canada
>session.load(user, user)

Didn't know you could do that. Very cool and elegant syntax!!

:)


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.