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?