Bonjour,
Voila, j'ai une requête qui en SQL est assez simple mais j'ai pas clairement compris comment bien faire en HQL.
en SQL :
Code:
select distinct user_id from GROUP_MEMBERS where group_id = ?
bien sur, j'aimerais récupérer le 'primaryKey' de chaque utilisateur appartenant au groupe.
Hibernate version: 3.1
Mapping documents:Code:
<class name="UserBMP" table="USERS" node="user">
<id name="primaryKey" column="user_id" type="java.lang.String" node="@user_id" unsaved-value="null"/>
...
<set name="groups" table="GROUP_MEMBERS" fetch="select" lazy="true" embed-xml="false" cascade="persist,save-update" inverse="true">
<key column="user_id"/>
<many-to-many column="group_id" class="GroupBMP" embed-xml="false" fetch="select"/>
</set>
</class>