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)
|
|