-->
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: composite-id and calendar
PostPosted: Tue Sep 13, 2005 4:53 am 
Newbie

Joined: Tue Sep 13, 2005 4:38 am
Posts: 1
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>


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.