-->
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: BigDecimal scale problem
PostPosted: Wed Jul 26, 2006 7:38 am 
Newbie

Joined: Mon May 29, 2006 6:07 am
Posts: 12
Hi...

Hibernate version 3.0
MySql 4.1

I have this class:

public class Cheque {

public long id;
public Date fecha;
public BigDecimal importe;

getters
setters

}

and in the mapping i have:

<property name="importe" column="importe" type="java.math.BigDecimal" length="10" precision="8" scale="3" />

I need this format in the variable "importe": (Eg. 504.89)
but the table Cheque in MySql its appears

importe:
type decimal
length 10
decimals 0

and i need the decimal sets to 3

Can anyone help me???


Top
 Profile  
 
 Post subject: Ya lo resolvistes???
PostPosted: Wed Aug 23, 2006 3:09 am 
Newbie

Joined: Wed Aug 23, 2006 3:07 am
Posts: 1
Hola, actualmente tengo el mismo problema que tu y quisiera saber si me podrías ayudar.

Gracias y un saludo.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 23, 2006 3:26 am 
Expert
Expert

Joined: Thu Sep 22, 2005 10:29 am
Posts: 285
Location: Almassera/Valencia/Spain/EU/Earth/Solar system/Milky Way/Local Group/Virgo Supercluster
Try with:
Prueba con:

Code:
<property name="importe" column="importe" type="java.math.BigDecimal" precision="8" scale="3" />


Please, don't forget to rate.
Venga, no seas así y dale al botoncico pa que me dé créditos.


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