Hi,
we want to use a composite-id (Integer + Calendar) but a SQLException occurs when we try to load an entity :
the value of a SQL variable or the parameter n°2 can't be used because of its data type
(translation from French, sorry for approximations)
So it seems there's a problem with the Calendar. Any idea ?
Thanks in advance
we use
Hibernate 2.1
jdk ibm 1.3.1
DB2 v8
Here is what we get in the hibernate log just before the SQLException :
13/09/2005 10:48:03 [DEBUG] net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(237) : select dettesstru0_.NSIREN as NSIREN0_, dettesstru0_.D_CLOTURE_EXE as D_CLOTUR2_0_, dettesstru0_.M_EMPRUNT_SUR_SCI as M_EMPRUN3_0_, dettesstru0_.M_CBI_SUR_SCI as M_CBI_SU4_0_, dettesstru0_.M_EMPRUNT_SUR_LBO as M_EMPRUN5_0_ from DBM01.DEST_DETTE_STRUCTURE dettesstru0_ where dettesstru0_.NSIREN=? and dettesstru0_.D_CLOTURE_EXE=?
13/09/2005 10:48:03 [DEBUG] net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(241) : preparing statement
13/09/2005 10:48:03 [DEBUG] net.sf.hibernate.type.NullableType.nullSafeSet(46) : binding '0' to parameter: 1
13/09/2005 10:48:03 [DEBUG] net.sf.hibernate.type.NullableType.nullSafeSet(46) : binding '13 septembre 2005 10:48:03' to parameter: 2
13/09/2005 10:48:03 [DEBUG] net.sf.hibernate.util.JDBCExceptionReporter.logExceptions(36) : SQL Exception
The mapping of our composite-id :
<composite-id name="key" class="fr.bdpme.gdc.beans.hibernate.DettesStructuresLiees$DSLKey">
<key-property name="numeroSIREN" type="java.lang.Integer" column="NSIREN"/>
<key-property name="dateClotureExercice" type="java.util.Calendar" column="D_CLOTURE_EXE" />
</composite-id>
|