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.  [ 2 posts ] 
Author Message
 Post subject: one-to-many et clé triple !
PostPosted: Mon May 29, 2006 11:04 am 
Newbie

Joined: Mon May 29, 2006 10:49 am
Posts: 2
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 4:40 am 
Newbie

Joined: Mon May 29, 2006 10:49 am
Posts: 2
Le problème est résolu par ... un redemarrage du poste client et du serveur de BD ...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.