Bonjour,
j'ai un problème avec les criteria et les jointures...
j'ai une classe Organisme :
puis la classe CodeStructure :Code:
1
2
3
4
5
6
7
8
9
10
11 <hibernate-mapping package="metier.dto"> <class name="Organisme" table="FE_ODF_IHM" dynamic-update="false"> <composite-id> <key-many-to-one name="nature" class="Nature" column="D_CNTRODF"/> <key-many-to-one name="moyen" class="Moyen" column="D_CMOYODF"/> <key-many-to-one name="codeStructure" class="CodeStructure" column="D_CRATODF"/> </composite-id> <property name="dateVerrouillage" column="D_DVRODF" type="date" not-null="false" length="16"/> <property name="libelleOrganisme" column="D_LODF" type="string" not-null="false" length="65"/> </class> </hibernate-mapping>
puis Structure :Code:
1
2
3
4
5
6
7
8
9
10 <hibernate-mapping package="metier.dto"> <class name="CodeStructure" table="FE_RATODF_IHM" dynamic-update="false"> <id name="id" type="string" column="D_CRATODF"/> <many-to-one name="structure" column="C_CSTRODF" class="Structure" not-null="false"/> <set name="listeOrganisme" inverse="true"> <key column="D_CRATODF"/> <one-to-many class="Organisme"/> </set> </class> </hibernate-mapping>
Code:
1
2
3
4
5
6
7
8
9
10 <hibernate-mapping package="metier.dto"> <class name="Structure" table="FE_STRODF_IHM" dynamic-update="false"> <id name="id" type="string" column="D_CSTRODF"/> <property name="libelle" column="D_LSTRODF" type="string" not-null="false" length="50"/> <set name="listeCodeStructure" inverse="true"> <key column="D_CSTRODF"/> <one-to-many class="CodeStructure"/> </set> </class> </hibernate-mapping>
Je voudrais récupérer tous les organismes répondant à certains indices de structures (champ id de la table structure)
J'ai donc testé ca mais ca marche pas :
mais il me mets :Code:criteria.add( Expression.in("codeStructure.structure.id",listeCodeStructure));
je ne vois pas trop comment faire...si vous avez des idées merci!!Code:org.hibernate.QueryException: could not resolve property: codeStructure.structure.id of: metier.dto.Organisme
a++