Joined: Fri Aug 26, 2005 8:09 am Posts: 1
|
Hibernate version 3.0.5
Websphere 5.1
Oracle
Hi! When i try to load an object representing a table on oracle with a primary key CHAR(6) i get an error...
I used the OracleCHAR class but in the stack trace i see the error in the end of this post.
My XML is like this:
<class name="prodottotariffa.TariffaVO" table="TARIFFA">
<id name="codTariffa" type="OracleCHAR" column="COD_TARIFFA" >
<generator class="assigned"/>
</id>
..............
Obviously if if use the TrimmedString class or a simple String i cannot load the entity unless i set the right number of blank in the end of the key!
I don't understand why i get the message: java.sql.SQLException: Tipo di colonna non valido (something like "column type not valid" in english)
Can someone help me?
Thanks in advance
ERROR LOG:
Hibernate: select tariffavo0_.COD_TARIFFA as COD1_0_,
..................................
tariffavo0_.FLG_BENEFICIARIO_CENSITO as FLG86_2_0_ from TARIFFA tariffavo0_ where tariffavo0_.COD_TARIFFA=?
ERROR - Tipo di colonna non valido
Eccezione:could not load an entity: [prodottotariffa.TariffaVO#U620]
org.hibernate.exception.GenericJDBCException: could not load an entity: [prodottotariffa.TariffaVO#U620]
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1359)
at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:116)
at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:101)
at org.hibernate.persister.entity.BasicEntityPersister.load(BasicEntityPersister.java:2471)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:351)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:332)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:113)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:75)
at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:643)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:59)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:84)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:134)
at prodottotariffa.TariffaVO$$EnhancerByCGLIB$$67222862.getDescrizioneBreve(<generated>)
at Client.main(Client.java:53)
Caused by: java.sql.SQLException: Tipo di colonna non valido
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2034)
at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2052)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setObject(NewProxyPreparedStatement.java:390)
at ibm.fev.utility.[color=red]OracleFixedChar.nullSafeSet(OracleFixedChar.java:60)[/color]
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:151)
at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1115)
|
|