From: St-Pierre P. <Phi...@lo...> - 2003-11-24 17:36:24
|
Hi everyone, I have an object named EntiteAffaire that has a collection (many-to-many relation with a composite-element) of coordinate. A coordin= ate can be a telephone, an address or an email. In the coordinate table, ther= e is a field named "KIND_COO" that tells me which kind of coordinate is in = the current row. Is it possible to specify a where clause for the set named entiteCoordonnees to get only one kind of coordinate in the set? This way= , I would be able to defined three sets, one for each kind of coordinate. I succeed to specify a where clause that map to a field of the collection table (utl.t_entite_coordonnee_l), but not to the coordinate table, which= is the end point of the relation. <class name=3D"com.iris.business.component.util.EntiteAffaire" schema=3D"UTL" table=3D"T_ENTITE_AFFAIRE"> <id name=3D"id" type=3D"string" column=3D"ID_EA" unsaved-value=3D"null"> <generator class=3D"com.iris.infrastructure.services.identification.UniqueIDProvider= Hiber nateImpl"/> </id> <set name=3D"entiteCoordonnees" schema=3D"UTL" table=3D"T_ENTITE_COORDONNEE_L" lazy=3D"true" cascade=3D"all" > <key column=3D"ID_EA"/> =09 <composite-element class=3D"com.iris.business.component.util.EntiteCoordonnee"> <property name=3D"utilisation" column=3D"REF_UTIL_COORD_EC" type=3D"string" not-null=3D"true"/> <many-to-one name=3D"coordonnee"=20 column=3D"ID_COO"=20 =09 class=3D"com.iris.business.component.util.CoordonneeUtil"=20 not-null=3D"true" =20 cascade=3D"all"/> </composite-element> </set> </class> SQL> desc utl.t_entite_affaire; Name Null? Type ----------------------------------------- -------- ---------------------------- ID_EA NOT NULL NUMBER(28) DATE_DERNIERE_MAJ NOT NULL TIMESTAMP(6) SQL> desc utl.t_entite_coordonnee_l; Name Null? Type ----------------------------------------- -------- ---------------------------- ID_COO NOT NULL NUMBER(28) ID_EA NOT NULL NUMBER(28) REF_UTIL_COORD_EC NOT NULL VARCHAR2(19) DATE_DERNIERE_MAJ NOT NULL TIMESTAMP(6) SQL> desc utl.t_coordonnee; Name Null? Type ----------------------------------------- -------- ---------------------------- ID_COO NOT NULL NUMBER(28) KIND_COO NOT NULL VARCHAR2(19) DATE_DERNIERE_MAJ NOT NULL TIMESTAMP(6) I hope that my question is clear enough... Philip St-Pierre > Loto-Qu=E9bec - Projet IRIS (Centre de livraison) Analyste-Programmeur > * phi...@lo... >=20 >=20 |