-->
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: Max Length Column Mapping for Integer
PostPosted: Wed Mar 09, 2005 3:04 pm 
Newbie

Joined: Wed Mar 09, 2005 2:43 pm
Posts: 4
Hi,

I have a table with a column defined as NUMBER(12) and with a value 999999999999 (12 digits), and I'm mapping this column as an Integer.

When I'm making a simple find (even if I'm retrieving only one row) I'm having this exception:

18:29:20,035 ERROR [SProductDimensionBean:426] net.sf.hibernate.exception.GenericJDBCException: Could not execute query
net.sf.hibernate.exception.GenericJDBCException: Could not execute query
at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)
at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:79)
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at net.sf.hibernate.impl.SessionImpl.convert(SessionImpl.java:4131)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1557)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1531)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1523)
....

My questions are:

1. Is there a maximum length for mapping a column into an Integer value?

2. Is this maximum less than 12?

3. What must I use? Long or BigInteger?

The max number I can load using Hibernate is a number with 9 digits.

Thanks in advance,
Sérgio


Top
 Profile  
 
 Post subject: Hibernate version
PostPosted: Wed Mar 09, 2005 3:50 pm 
Newbie

Joined: Wed Mar 09, 2005 2:43 pm
Posts: 4
I,ve forgot to tell that I'm using Hibernate version 2.1.8 and Oracle 9i.

Regards,
Sérgio


Top
 Profile  
 
 Post subject: Answer
PostPosted: Thu Mar 10, 2005 4:47 am 
Newbie

Joined: Wed Mar 09, 2005 2:43 pm
Posts: 4
Hi,

don't even bother to answer this question.

The maximum value of an Integer is (2^31)-1 = 2147483647, which is a NUMBER(10) but in a range less then 2147483647.

Sorry to waste your time.

Sérgio


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.