-->
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: one-to-many, join et clause where manquante
PostPosted: Fri Jan 27, 2006 6:13 am 
Newbie

Joined: Fri Mar 05, 2004 8:55 am
Posts: 19
Hibernate version:3.1


j'ai une association bidirectionnelle un-à-plusieurs (one-to-many) sur une table de jointure (legacy a mapper).


Code:
<set name="enfants" table="PARENT_ENFANT"  where="COND = '1'" >
   <key column="GRCOD"/>
   <many-to-many column="GRECH" unique="true" class="Enfant" />
</set>

<join table="PARENT_ENFANT" inverse="true" optional="false"  >
   <key column="GRECH" />
   <many-to-one name="parent" class="Parent"  column="GRCOD"   />
</join>



j'ai une restriction sur la table d'asociation (données historisées) avec un where.
Or dans le join, il n'est pas possible de preciser ce meme where, ce qui donne l'exception:

More than one row with the given identifier was found.

je vois dans la doc qu'il est possible d'ajouter un subselect dans le join, ce qui devrai pouvoir resoudre mon probleme (mais impose une requete imbriquée).

pourquoi cette limitation pour un simple where sur la table d'association?


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.