-->
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: DB2 decimal(17,4) column mapping
PostPosted: Fri Sep 04, 2009 9:15 am 
Newbie

Joined: Fri May 25, 2007 3:58 pm
Posts: 10
I need some help. I have a DB2 column type of decimal (17,4) which I need to map, but everything I've tried is not working. I'm using Spring 2.0.8 with Hibernate3. I've tried multiple configurations and for the most part I keep getting the same error. The variable I'm mapping to is a BigDecimal.

Can someone please let me know what the mapping line should look like?

I'm trying to deploy to Weblogic 8.1.6 and the error I get is "Could not determine type for: decimal". My current mapping line for this field looks like:
Code:
<property name="unitPrice" scale="4" column="Z_DD_COST_EACH" unique="false" precision="17" not-null="true" type="decimal"/>


The ddl for the database line is:
Code:
  Z_DD_COST_EACH      DECIMAL(17, 4)  NOT NULL,


Top
 Profile  
 
 Post subject: Re: DB2 decimal(17,4) column mapping
PostPosted: Fri Sep 04, 2009 10:39 am 
Newbie

Joined: Fri May 25, 2007 3:58 pm
Posts: 10
I've come up with the correct combination of factors.

Mapping Line:
Code:
<property name="unitPrice" scale="4" column="Z_DD_COST_EACH" unique="false" precision="17" not-null="true" type="big_integer"/>


The variable I'm mapping to is a BigDecimal.

I also had to extend the Db2Dialect and put an entry in it like:
Code:
registerColumnType(Types.NUMERIC, "decimal($p,$s)");


I hope this helps anyone having the same problem as me.


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.