I'm trying to solve the same problem, although I'm using oracle 9i. I tried the "select" generator, but it's not quite working. From my HBM file:
<id name="oid">
<column name="OID"/>
<generator class="select">
<param name="key">OID</param>
</generator>
</id>
When I run with this, I get the exception that follows this. My Java "oid" property is an "int", and my column is defined as NUMBER(10). I tried stepping into the Hibernate code for this. It's a little hard to interpret, but it seems like the resultset has a single column, named "ROWID", but I could be misinterpreting what I'm seeing in the debugger.
Caused by: java.sql.SQLException: [BEA][Oracle JDBC Driver]Value can not be converted to requested type.
at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
at weblogic.jdbc.base.BaseData.getInteger(Unknown Source)
at weblogic.jdbc.base.BaseResultSet.getInt(Unknown Source)
at weblogic.jdbc.wrapper.ResultSet_weblogic_jdbc_base_BaseResultSet.getInt(Unknown Source)
at org.hibernate.id.IdentifierGeneratorFactory.get(IdentifierGeneratorFactory.java:50)
at org.hibernate.id.IdentifierGeneratorFactory.getGeneratedIdentity(IdentifierGeneratorFactory.java:35)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1761)
|