Re: EOQualifier, contains, and a pair of relationships

Chuck Hill <[email protected]> Mon, 15 Aug 2011 11:54:26 -0700
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Hi Ondra,

I don't think that you can do this using qualifierWithQualifierFormat.  =
Wonder (ERXExtensions) and Houdah frameworks have additional qualifiers. =
 You should be able to get the select that you want using those.


Chuck



On 2011-08-15, at 11:36 AM, Ond=C5=99ej =C4=8Cada wrote:

> Hello there,
>=20
> possibly I do something wrong, but can't see what -- any help please?
>=20
> I need to filter by a presence of another object in a two-level =
N:1/M:N relationship. Means that an enterprise object X should be =
displayed in the DG iff its relToOne leads to any Y whose relToMany =
contains Z.
>=20
> Well, what I do is
>=20
> EOQualifier.qualifierWithQualifierFormat("relToOne.relToMany contains =
%@",new NSArray(Z));
>=20
> is that conceptually right?
>=20
> Anyway it does generate _almost_ proper SQL; alas, in one place =
there's a LIKE instead of =3D, namely (cleaned up from the unimportant =
stuff)
>=20
> SELECT
>  t0.C_CREATION_DATE, ..., t0.C_UID FROM T_AUDIT AS t0,
>  T_USER_GROUP_USER AS T2,
>  T_USER_GROUP AS T3,
>  T_USER AS T1
> WHERE (T3.C_UID LIKE 1000004) AND (T1.C_UID=3DT2.C_USER_ID) AND =
(T2.C_GROUP_ID=3DT3.C_UID) AND (t0.C_CREATOR_ID=3DT1.C_UID);
>=20
> Any idea what do I do wrong and what causes the nonsense LIKE there? =
Had there be a =3D instead, it would work like a charm.
>=20
> Or -- I admit I am no SQL guru -- should the LIKE work and it is a =
fault of my database (FrontBase 4.4.10) that it chokes over the thing?
>=20
> And most important, any idea how to fix the problem?
>=20
> Thanks a lot!
> ---
> Ondra =C4=8Cada
> OCSoftware:     [email protected]               http://www.ocs.cz
> private         [email protected]             http://www.ocs.cz/oc
>=20
>=20
>=20
> _______________________________________________
> WebObjects-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev

--=20
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall =
knowledge of WebObjects or who are trying to solve specific problems.   =20=

http://www.global-village.net/products/practical_webobjects