Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.1
Bonjour à tous, j'essaye de mapper une relation one to many et une clé triple.
J'ai des relation de la forme :
TAV101 (
HWOR_IDT)
TAV103 (
HWOR_IDT, SISP_CCO)
TAV104 (
HWOR_IDT, CHPR_ASKMAKCAR, SISP_CCO)
(J'ai seulement indiqué les clés)
Donc :
TAV101 peut avoir un ou plusieurs TAV103 qui peut avoir 1 ou plusieurs TAV104
Je sais que les tables sont assez bizarres mais j'ai pas le choiw sur la structure.
J'ai fait le mapping suivant :
la relation en java
/**
* @hibernate.set table="TAV104" lazy="false"
* @hibernate.key
* @hibernate.key-column name="HWOR_IDT"
* @hibernate.key-column name="CHPR_ASKMAKCAR"
* @hibernate.one-to-many class="callisto.model.hwo.SideSpecification"
*/
private Set SideSpecificationExtCharacteristicsProduce = new HashSet();
le mapping :
<class table="TAV103" lazy="false" name="callisto.model.hwo.CharacteristicsProduce">
<composite-id name="idCharacteristicsProduce">
<key-property type="string" column="CHPR_ASKMAKCAR" name="askerOrMakerCharacteristicsCPKey"/>
<key-property type="integer" column="HWOR_IDT" name="idCharacteristicsProduceKey"/>
</composite-id>
<set table="TAV104" lazy="false" name="SideSpecificationExtCharacteristicsProduce">
<key>
<column name="HWOR_IDT"/>
<column name="CHPR_ASKMAKCAR"/>
</key>
<one-to-many class="callisto.model.hwo.SideSpecification"/>
</set>
<class table="TAV104" lazy="false" name="callisto.model.hwo.SideSpecification">
<composite-id name="idSideSpecification">
<key-property type="string" column="CHPR_ASKMAKCAR" name="askerOrMakerCharacteristicsSSKey"/>
<key-property type="integer" column="HWOR_IDT" name="idSideSpecificationKey"/>
<key-property type="string" column="SISP_CCO" name="sideSSKey"/>
</composite-id>
</class>
Quand je fait un select sur TAV103, j'obtiens :
[29/05/06 16:26:22:726 CEST] 573ac593 JDBCException W org.hibernate.util.JDBCExceptionReporter SQL Error: -99999, SQLState: 22005
[29/05/06 16:26:22:747 CEST] 573ac593 JDBCException E org.hibernate.util.JDBCExceptionReporter [IBM][CLI Driver] CLI0112E Error in assignment. SQLSTATE=22005
[29/05/06 16:26:22:767 CEST] 573ac593 SystemOut O 46826 2006-05-29 16:26:22,757 ERROR callisto.meow.persistence.query.HibernateQueryImpl e012648 meow.persistence.query.HibernateQueryImpl.logError(HibernateQueryImpl.java:78) Unable to execute the Query (list)
org.hibernate.exception.DataException: could not initialize a collection: [callisto.model.hwo.CharacteristicsProduce.SideSpecificationExtCharacteristicsProduce#component[askerOrMakerCharacteristicsCPKey,idCharacteristicsProduceKey]{idCharacteristicsProduceKey=3, askerOrMakerCharacteristicsCPKey=M}]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:75)
J'ai vérifié mes types de données, ils sont ok
Quelqu'un a une idée ?
Merci par avance