-->
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.  [ 6 posts ] 
Author Message
 Post subject: Mapping decimal precission
PostPosted: Thu May 12, 2005 5:35 pm 
Regular
Regular

Joined: Thu May 12, 2005 10:12 am
Posts: 71
Location: Buenos Aires, Argentina
Hi, sorry for the cross post in sourceforge until at least I'm sure everyone's looking also here.

I was wondering how to map a decimal and assign the precision in the DB. It doesnt matter how much the precission is in the DB, nhibernate always saves 5 decimal numbers and the rest is filled with zeros.

Am I missing something?

Also, is this possible to do with NullableTypes ?

thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 6:58 pm 
Regular
Regular

Joined: Thu May 12, 2005 10:12 am
Posts: 71
Location: Buenos Aires, Argentina
I'm sorry...the bug is related to Nullable types, not de decimal itself.

This raises a new question: how can I pass constructor parameters to nhibernate types in the mapping file. So instead of having a NullableDecimal I can have NullableDecimal(2,9) per example.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 7:21 pm 
Regular
Regular

Joined: Thu May 12, 2005 10:12 am
Posts: 71
Location: Buenos Aires, Argentina
I seem to have found the error. I found the following line inside SqlClientDriver.cs. The culprit seem to be here:

case DbType.Decimal:
pps = parameter as ParameterPrecisionScale;
//TODO: remove this hardcoding...
dbParam.Precision = 19;
dbParam.Scale = 5;
break;

Seems like someone missed the TODO


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 2:42 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Created http://jira.nhibernate.org/browse/NH-271 about this. I actually believe it's possible, but I need to look at the source.


Top
 Profile  
 
 Post subject: Mapping decimal precission
PostPosted: Wed Aug 02, 2006 3:28 am 
Newbie

Joined: Fri Jul 21, 2006 8:47 am
Posts: 1
I have the same problem!

I would want to use the NullableDecimalType with the precision and scale!

Can I declare the precision and scale for nullable decimal type?

Have you find a solution?


Top
 Profile  
 
 Post subject: Mapping NullableDecimal precision
PostPosted: Thu Aug 16, 2007 4:59 am 
Newbie

Joined: Fri Oct 06, 2006 1:25 pm
Posts: 5
I have the same problem

It will be great to make possible to define the NullableDecimal type precision in the mapping files.
The precision can not exceed 5 decimal numbers ...


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