This one time, at band camp, Molyneaux, Kevin said:
MK>When ever i try to include two objects in my FROM clause. I get the following
error:
MK>
MK> OQLSyntaxException: An incorrect token type was found near , (45, need 0"
MK>
MK>The OQL I am executing follows:
MK>
MK> Select obj
MK> FROM
MK> com.sys.ilink.display.text.dataobject.TextDO obj,
MK> com.sys.ilink.display.text.dataobject.VersDO versDO
MK> where
MK> obj.displayTxtId = $1 and
MK> obj.locale = $2 and
MK>
MK> versDO.displayTextId = obj.displayTextId
MK>
MK>
MK>In the JDO FAQ it seems to suggest that this is allowed (shown bellow). Also in
the OQL Advanced section the from clause clearly supports "from obj [, obj]".
MK>
MK>When I tried to write the query the second way suggested "bellow", I got a
ArrayIndexOutOfBoundsException: 1 exception when trying to query on something in the
second object such as obj.versDO.effectiveDate < $1.
MK>
MK>
MK>
MK>Any suggestions! Thanks,
MK>
MK>Kevin M
MK>
MK>
MK>
MK> I cannot get Castor OQL to join two objects for me. Is it supported?
MK> Yes or no. Castor OQL supports implicit joins. And, in most case, you simply
don't need explicit join.
MK> Consider the following example,
MK> SELECT o FROM Order o, LineItem i
MK> WHERE o.id = i.id AND i.price > 100
MK>
MK> It is simply equivalent to the following OQL
MK> SELECT o FROM Order o,
MK> WHERE o.lineItem.price > 100
Kevin,
The current implemenation of OQL does not support explicit joins. The docs
are incorrect. This is a symptom of the lack of contribution - there are
currently only two active developers for JDO. We're actively seeking
contributors ;-)
Joins are performed based on the mapping descriptor and the relationships
specified therein. Please post the relevant portion(s) of your mapping
descriptor for the objects that you're trying to query so we can see
what we're dealing with here.
Bruce
--
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev