-->
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.  [ 1 post ] 
Author Message
 Post subject: Mapped Sequenced Column saved wrongly in Oracle 9i (9.0.1.1)
PostPosted: Wed Nov 08, 2006 9:03 am 
Newbie

Joined: Thu Oct 26, 2006 2:23 am
Posts: 2
Environment : Oracle 9i (9.0.1.1.1)
Hibernate Version : Hibernate2
Dialect : Oracle9Dialect

I do have table named (TABLE) with unquie column tableRowId and used sequence id generation with the Sequence (TABLE_SEQ) created in the DB.
----------
HBM file
----------

<hibernate-mapping auto-import="false">
<class
name="com.ex.Table"
table="TABLE"
dynamic-update="true"
dynamic-insert="true"
select-before-update="false"
optimistic-lock="version"
>
<cache usage="read-write" />

<id name="tableRowId" column="TABLE_RID" type="int">
<generator class="native">
<param name="sequence">TABLE_SEQ</param>
</generator>
</id>
</hibernate-mapping>

When i save the object, the value of the rowid is saved/inserted in form of 1.39E26.. etc randomly though the type of the column in int. so when i try read back the object i get the numeric overflow error since the value is out of range for an Integer

----------------------------
Stack Trace of the error:
----------------------------
java.sql.SQLException: Numeric Overflow
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.NumberCommonAccessor.throwOverflow(NumberCommonAccessor.java:7465)
at oracle.jdbc.driver.NumberCommonAccessor.getInt(NumberCommonAccessor.java:103)
at oracle.jdbc.driver.OracleResultSetImpl.getInt(OracleResultSetImpl.java:521)
at oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:1563)
at net.sf.hibernate.type.IntegerType.get(IntegerType.java:18)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
at net.sf.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:427)
at net.sf.hibernate.loader.Loader.getRowFromResultSet(Loader.java:200)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:281)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1544)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.