Re: Really complicated query (or not?)
Re: Really complicated query (or not?)
- Subject: Re: Really complicated query (or not?)
- From: Miguel Arroz <email@hidden>
- Date: Sun, 8 Jul 2007 12:22:52 +0100
Hi!
On 2007/07/08, at 07:21, Lachlan Deck wrote:
+-----+ +-----+ +------+ +------+
| R | <--->> | A | <--->> | AP | <<---> | QO |
+-----+ +-----+ +------+ +------+
^
^
|
|
V
+------+
| QP |
+------+
Here's my initial assumptions:
- the relationship from R to A is 'as', and from A to AP is 'aps',
seeing as they're both toMany relations...
Yes, that is correct.
- by QO = "qo" you mean "as.aps.qo" contains (QO)qo1
- by QP = "qp" you mean "as.aps.qp" contains (QP)qp1.
I'm not sure about these. Note that the relation from AP to QO (or
QP) is a toOne.
So something like...
QO qo1, qo2; // assume these exist
QP qp1, qp2; // assume these exist
EOQualifier x;
EOQualifier y;
x = new EOAndQualifier(new NSArray(new Object[] {
new EOKeyValueQualifier("as.aps.aValue",
EOQualifier.QualifierOperatorContains, "x"),
new EOKeyValueQualifier("as.aps.qo",
EOQualifier.QualifierOperatorContains, qo1),
new EOKeyValueQualifier("as.aps.qp",
EOQualifier.QualifierOperatorContains, qp1)
}));
y = new EOAndQualifier(new NSArray(new Object[] {
new EOKeyValueQualifier("as.aps.aValue",
EOQualifier.QualifierOperatorContains, "y"),
new EOKeyValueQualifier("as.aps.qo",
EOQualifier.QualifierOperatorContains, qo2),
new EOKeyValueQualifier("as.aps.qp",
EOQualifier.QualifierOperatorContains, qp2)
}));
What confuses me here is that there is nothing here that imposes
the constraint that, for each qualifier, the AP must be the same for
the 3 conditions. If I undertand this correctly, qualifier x says
that we want a R that (contains an A that contains an AP whose aValue
is "x") and (contains an A that contains an AP whose QO is qo1) and
(contains an A that contains an AP whose QP is qp1). But it doesn't
say that A and AP are the same in the three conditions, right? So I
may be getting different APs, each onde validates one condition, but
none validates the 3 conditions, right? Or am I reading this all wrong?
Yours
Miguel Arroz
Miguel Arroz
http://www.terminalapp.net
http://www.ipragma.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden