Re: EOQualifier, contains, and a pair of relationships

"Pierre Gilquin" <[email protected]> Tue, 16 Aug 2011 09:33:15 +0200
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Not a qualifier, but you can get the raw data from any sql using :
NSArray rawRows=3D EOUtilities.rawRowsForSQL(ec, "Your model", "SELECT t0=
.C_CREATION_DATE, ...,    ");

Pierre
----- Original Message -----=20
From: Chuck Hill
To: Ond=C5=99ej =C4=8Cada
Cc: WebObjects Dev Dev
Sent: Monday, August 15, 2011 8:54 PM
Subject: Re: EOQualifier, contains, and a pair of relationships


Hi Ondra,

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


Chuck



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

> Hello there,
>
> possibly I do something wrong, but can't see what -- any help please?
>
> I need to filter by a presence of another object in a two-level N:1/M:N=
 relationship. Means that an enterprise object=20
> X should be displayed in the DG iff its relToOne leads to any Y whose r=
elToMany contains Z.
>
> Well, what I do is
>
> EOQualifier.qualifierWithQualifierFormat("relToOne.relToMany contains %=
@",new NSArray(Z));
>
> is that conceptually right?
>
> Anyway it does generate _almost_ proper SQL; alas, in one place there's=
 a LIKE instead of =3D, namely (cleaned up from=20
> the unimportant stuff)
>
> 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_G=
ROUP_ID=3DT3.C_UID) AND (t0.C_CREATOR_ID=3DT1.C_UID);
>
> Any idea what do I do wrong and what causes the nonsense LIKE there? Ha=
d there be a =3D instead, it would work like a=20
> charm.
>
> Or -- I admit I am no SQL guru -- should the LIKE work and it is a faul=
t of my database (FrontBase 4.4.10) that it=20
> chokes over the thing?
>
> And most important, any idea how to fix the problem?
>
> Thanks a lot!
> ---
> Ondra =C4=8Cada
> OCSoftware:     [email protected]               http://www.ocs.cz
> private         [email protected]             http://www.ocs.cz/oc
>
>
>
> _______________________________________________
> 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=20
solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________
WebObjects-dev mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/webobjects-dev=20