-->
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.  [ 2 posts ] 
Author Message
 Post subject: About the page. 204 and MonetaryAmount
PostPosted: Tue Feb 22, 2005 5:36 am 
Newbie

Joined: Thu Feb 17, 2005 2:11 am
Posts: 1
Location: Taipei, Taiwan
Excuse me, I have two questions about the Listing 6.1 of page. 204

1.I have seen the errata list. There is a correction in Listing 6.1 of page. 204

Code:
204, listing 6.1, switch the lines "if (resultSet.wasNull())..." and "BigDecimal valueInUSD"


Maybe my English is too poor to realize the meaning of "switch the lines" ,
could anyone please tell me what the "switch the lines" actully means?

2.In the method "nullsafeSet", there are some codes like follows:
Code:
MonetaryAmount anyCurrency = (MonetaryAmount)value;


Why could the object "value" directly cast into an object of type "MonetaryAmount"
and use anyCurrency as a parameter of method "convert"?

Does class "MonetaryAmount" have any relationship with class "BigDecimal"?

Thanks for all your reply.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 22, 2005 6:22 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Switch means move A to B and B to A position.

Also, I think you are getting very distracted by implementation details of the MonetaryAmountUserType. It doesn't make sense if you don't understand the context that is explained, that is UserTypes in general. It doesn't really matter what you or I implement in these methods, as long as you understand when they are useful.


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