-->
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.  [ 3 posts ] 
Author Message
 Post subject: hibernate v3 -> Probleme de delete
PostPosted: Tue Sep 13, 2005 1:07 pm 
Newbie

Joined: Tue Sep 13, 2005 12:24 pm
Posts: 5
Location: paris
bonjour,

je voudrait savoir si quelqu'un a une idée pour faire ce delete :
voici un bout du mapping .hmb

Code:
<class name="CrjurCrori" table="CRJUR_CRORI">
      <composite-id>
         <key-many-to-one class="Caisse" name="crJur"  >
            <column name="NO_CR_JUR" />
            <column name="EX_CR_JUR" />
            <column name="CD_STE_CR_JUR" />
         </key-many-to-one>
         <key-many-to-one class="Caisse" name="crOri"  >
            <column name="NO_CR_ORI" />
            <column name="EX_CR_ORI" />
            <column name="CD_STE_CR_ORI" />
         </key-many-to-one>
      </composite-id>
   </class>


comme on peut le voir on a un objet CrjurCrori qui est composé de 2 objet Caisse ;
un objet Caisse est composé d'une PK (id)
lui-meme composé d'un objet Societe (dont le PK est CD_STE_CR_JUR) et de 2 String.

on veut supprimer tous les enregistrement pour EX_CR_JUR = 2006
en SQL j'aurait fait ca : DELETE CRJUR_CRORI WHERE EX_CR_JUR = 2006 ( 2006 etant un parametre )
donc une requette à 2 francs ( heu! 0.3€ ) et bien impossible a ecrir en HQL j'ai testé ceci :
Code:
delete CrjurCrori where crJur.id.exCr = :exGener

avec un executeUpdate() mais rien a faire ca provoque une erreur :
Quote:
org.hibernate.QueryException: could not resolve property: id.exCr of: fr.groupama.ads.biz.beans.valueObjects.CrjurCrori [delete CrjurCrori where crJur.id.exCr = 2006]


a noter que
Code:
select CrjurCrori where crJur.id.exCr = :exGener
fonctionne bien


si quelqu'un à une idée, merci d'avance


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 6:06 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Essaye Hibernate 3.1beta3, il y avait un bug dans cette zone si je me souvient bien.
Sinon, ouvres un bug

_________________
Emmanuel


Top
 Profile  
 
 Post subject: ok ca marche
PostPosted: Wed Sep 14, 2005 1:16 pm 
Newbie

Joined: Tue Sep 13, 2005 12:24 pm
Posts: 5
Location: paris
ok ca marche

merci


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.