-->
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: Help. There seems a problem with BIGINT in Hibernate and DB2
PostPosted: Fri Mar 05, 2004 9:26 pm 
Newbie

Joined: Fri Mar 05, 2004 9:08 pm
Posts: 1
My mapping file is shown below.

STRINGCODE is a BIGINT in the database table.

When inserting values greater than 2^31 the value wraps. For example:
2153073601 is writen to the database as -2147483648.

But my configuration on line 20, says " type="long" By the way, I have bolded it in here just to emphasize it. What am I doing wrong? Or is there a bug in Hibernate.

I will appreciate any insight that I can get!

Thanks!

I am using Hibernate 2.1.1. There are no exceptions thrown when running.

Mapping file:
<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin

http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->

<class
name="org.somewhere.db.Stringmap"
table="STRINGMAP"
proxy="org.somewhere.db.objectstore.report.Stringmap"
>

<composite-id name="comp_id" class="org.somewhere.db.objectstore.report.StringmapPK">
<key-property
name="stringcode"
column="STRINGCODE"
type="long"
/>
<!-- bi-directional many-to-one association to Localemap -->
<key-many-to-one
name="localemap"
class="org.somewhere.db.objectstore.report.Localemap"
>
<column name="LOCALEID" />
</key-many-to-one>
</composite-id>

<property
name="stringvalue"
type="java.lang.String"
column="STRINGVALUE"
not-null="true"
length="1024"
/>

<!-- associations -->

</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 05, 2004 10:17 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
There is no bug in Hibernate, of course.


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.