Ondřej Čada
2011-08-15 18:36:35 UTC
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 X should be displayed in the DG iff its relToOne leads to any Y whose relToMany 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 =, namely (cleaned up from 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=T2.C_USER_ID) AND (T2.C_GROUP_ID=T3.C_UID) AND (t0.C_CREATOR_ID=T1.C_UID);
Any idea what do I do wrong and what causes the nonsense LIKE there? Had there be a = instead, it would work like a charm.
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?
And most important, any idea how to fix the problem?
Thanks a lot!
---
Ondra Čada
OCSoftware: ***@ocs.cz http://www.ocs.cz
private ***@ocs.cz http://www.ocs.cz/oc
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 X should be displayed in the DG iff its relToOne leads to any Y whose relToMany 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 =, namely (cleaned up from 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=T2.C_USER_ID) AND (T2.C_GROUP_ID=T3.C_UID) AND (t0.C_CREATOR_ID=T1.C_UID);
Any idea what do I do wrong and what causes the nonsense LIKE there? Had there be a = instead, it would work like a charm.
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?
And most important, any idea how to fix the problem?
Thanks a lot!
---
Ondra Čada
OCSoftware: ***@ocs.cz http://www.ocs.cz
private ***@ocs.cz http://www.ocs.cz/oc