-->
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: Mapping SQL Server 'Money' type
PostPosted: Wed Jun 25, 2008 9:59 pm 
Newbie

Joined: Wed Jun 25, 2008 9:46 pm
Posts: 2
I've been hunting for over 3 days now to find out how to map the SQL Server money type to hibernate, finally tried to create a Custom type which too fails

I was hoping the BigDecimal would work, but it just fails with the following message at startup leaving me pissed!!!

"Wrong column type in xxxxxxxx for column amount. Found: money, expected: numeric(19,2)"

1. The column type in SQL (2005) is money

2. My hbm mapping is

<property name="amount" type="big_decimal">
<column name="amount" not-null="true" />
</property>

This incidentally is generated by the Hibernate tool itself.

Hibernate version:3

Has anyone ever faced this issue.... What is it that i'm missing....Any inputs would be greatly appreciated.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2008 4:57 pm 
Newbie

Joined: Wed Nov 26, 2008 4:53 pm
Posts: 1
mumbaiCutting, I'm having the same problem. Have you figured out how to map to the Money type? Thanks in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 27, 2008 12:50 am 
Newbie

Joined: Wed Jun 25, 2008 9:46 pm
Posts: 2
ilbbq wrote:
mumbaiCutting, I'm having the same problem. Have you figured out how to map to the Money type? Thanks in advance!


Yeah, use the sql-type="money" as this :

<property name="field_name" type="big_decimal">
<column name="column_name" length="8" sql-type="money" not-null="true" />
</property>


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.