-->
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: Help with mapping long decimal field.
PostPosted: Mon Jan 23, 2006 11:56 pm 
Newbie

Joined: Mon Jan 23, 2006 11:44 pm
Posts: 15
Location: New Jersey, US
Hi,

I am using NHibernate 1.01 on Sql Server 2000. When I try to map a database field of decimal(16,8), only 5 digits is saved by NHibernate. For example, if I set the property, say a.price = 9.12345678, only 9.12345 is saved to the database field.

I tried to browse the source of 1.01 and found decimal(19,5) is defined in the code. Should I customize such code or what's other options?

Thanks
Hongze


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 24, 2006 5:30 am 
Regular
Regular

Joined: Tue Mar 15, 2005 12:38 pm
Posts: 73
Location: Bucharest
try using flat or double, I belive these are also supported.

Dragos


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 24, 2006 6:59 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Specify the correct type in the mapping file, for example type="Decimal(16,8)".


Top
 Profile  
 
 Post subject: Problem solved.
PostPosted: Tue Jan 24, 2006 11:12 am 
Newbie

Joined: Mon Jan 23, 2006 11:44 pm
Posts: 15
Location: New Jersey, US
sergey wrote:
Specify the correct type in the mapping file, for example type="Decimal(16,8)".


Hi sergey,

Decimal(16,8) works for me. When I saw you replay this morning I tried this type and it works. The strange thing is that I actually tried this yesterday and rebuild the whole project with no luck(I know I need rebuild instead of build the project containing the mapping file). Maybe this morning's reboot refreshed everything.

Thanks for pointing me to the direction.

Dado2003,

Thanks for the suggestion. Because Decimal(16,8) works for me, I didn't proceed to try double. Also, Decimal(16,8) sound technically correct to me.

Thanks again
Hongze


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.