-->
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.  [ 1 post ] 
Author Message
 Post subject: How to map SQL Server decimal(15,7) ?
PostPosted: Thu Aug 16, 2007 3:44 pm 
Newbie

Joined: Fri Jul 20, 2007 9:47 am
Posts: 1
Hibernate version: 3
Name and version of the database you are using: SQL Server 2005

I'm trying to map to the SQL Server column type decimal(15,7). I have hbm2ddl.auto set to validate. Using straight java & hibernate double produces error:

org.hibernate.HibernateException: Wrong column type: price, expected: double precision

and using long produces the error:

org.hibernate.HibernateException: Wrong column type: price, expected: numeric(19,0)

and using BigDecimal/big_decimal produces the error:

org.hibernate.HibernateException: Wrong column type: price, expected: numeric(19,2)

but if I add precision="15" scale="7" it becomes:

org.hibernate.HibernateException: Wrong column type: price, expected: numeric(15,7)


I must be missing something simple. All thoughts and advice appreciated.

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.