-->
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: Precision/scale property
PostPosted: Fri Apr 22, 2005 6:05 am 
Regular
Regular

Joined: Fri Sep 17, 2004 10:51 am
Posts: 61
Location: Rimini, Italy
I've the need to format the output of a BigDecimal field mapped in this way:
[code]
<property
name="price"
type="java.math.BigDecimal"
scale="2"
formula="PREZZO(...)"
/>
[code]

The output of the .toString() method doesn't include the final zero ( 20.1 instead of 20.10 ). Normally, setting the scale of the BigDecimal to 2 solves the problem, and I thought this can be accomplished by using scale="" field.
But this doesn't seem to work. For what the scale field is used ?
It's not described in the docs...

_________________
--
Marco


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2005 7:24 am 
Newbie

Joined: Wed Apr 20, 2005 12:58 pm
Posts: 8
I wonder if this is related to my earlier post by any chance?

"Annotations Alpha 3 to B1Preview - NoSuchMethodError"

Scale is not defined there as well.

getScale and setScale are undefined


Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.mapping.Column.getScale()I
at org.hibernate.cfg.Ejb3JoinColumn.linkValueUsingDefaultColumnNaming(Ejb3JoinColumn.java:203)
at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:96)
at org.hibernate.cfg.AnnotationBinder.bindFkSecondPass(AnnotationBinder.java:1265)
at org.hibernate.cfg.FkSecondPass.secondPass(FkSecondPass.java:36)
at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:31)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:163)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:586)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:59)
at org.hibernate.test.annotations.CreateSchema.main(CreateSchema.java:36)


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.