-->
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: Hibernate mapping to DB2
PostPosted: Fri Sep 19, 2008 1:42 pm 
Newbie

Joined: Tue Sep 02, 2008 11:52 am
Posts: 2
When I map DB2 Numeric(8,0) to java.math.BigDecimal it works fine
but mapping Numeric(5,0) to java.math.BigDecimal fails

I tried mapping Numeric(5,0) to java.math.BigInteger, Integer, int, double, float, int, short
nothing works!


Code:
@Column(name = "WPIDLN")
   public java.math.BigDecimal getWpidln() {
      return this.wpidln;
   }

   public void setWpidln(java.math.BigDecimal wpidln) {
      this.wpidln = wpidln;
   }


Top
 Profile  
 
 Post subject: is numeric in DB2
PostPosted: Sat Sep 20, 2008 12:19 am 
Newbie

Joined: Fri Sep 19, 2008 6:59 am
Posts: 6
In DB2, use the Integer datatype for both using Numeric(5,0) and Numeric(8,0).
because anyways you are not making any use of the precision(since it's 0), so it's better to change the datatype in the database and map it to java.lang.Integer

_________________
Rahul


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.