Hi Bruce,
thanks for hint. But what I tried in particular was to match the whole
set, meaning that in the above example the comparison is true if and
only if a product ist related to _all_ the categories of the compared
set. So what I need is having sets (or maybe lists) on both sides of the
comparator: "product.categories" actually references a _java.util.Set_.
Changing it to list and rewriting the statement as:
"SELECT product FROM foo.Product product WHERE product.categories
<<<this is a set<<< IN LIST("cat1", "cat2", "cat3")"
will not work either. Do you have any more Ideas?
Enrico
> This one time, at band camp, Enrico Thor said:
>
> ET>does the current status of Castor JDO-OQL support set-construction
> ET>and comparison like this:
> ET>
> ET>"SELECT product FROM foo.Product product WHERE
> product.categories =
> ET>set(cat1, cat2, cat3)" ?
> ET>
> ET>Object "Product" has a "java.util.Set" of "Category". The
> ET>corresponding tables have many-to-many-relationship. I am just
> ET>starting on OQL but I think comparisons as the one above are
> ET>basically supported. From the castor-documentation I can't figure
> ET>out, if Castor JDO-OQL (which is currently in status 3) already
> ET>supports this.
> ET>
> ET>Using oracle as database the statement transfers to:
> ET>
> ET>[Castor] SELECT
> "PRODUCT"."ID","PRODUCT_CATEGORY"."CATEGORY_ID" FROM
> ET>"PRODUCT_CATEGORY","PRODUCT" WHERE
> ET>"PRODUCT"."ID"="PRODUCT_CATEGORY"."PRODUCT_ID"(+) AND
> ET>("PRODUCT"."CATEGORY_ID" = set('cat1' , 'cat2' , 'cat3'))
> ET>java.sql.SQLException: ORA-00936: Missing Expression
> ET>
> ET>which implies, that it is not supported but maybe I am using wrong
> ET>syntax?
>
> Enrico,
>
> Castor doesn't support comparison of a set but it does
> support a list. See the JDO FAQ here:
>
http://www.castor.org/jdo-faq.html#OQL
Look for the question, 'Does Castor support the SQL 'IN' expression?'.
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
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev