Hi
I'm having the same problem with the EXISTS statement. Accoring to the documentation
the EXISTS
statement is supported. My query is well formed according to Castor's modified EBNF
OQL
notation. Can somebody please tell us a bit more or point us in the right direction.
Thanks in advance,
Eduard
Jan Kanzleiter wrote:
> hi,
>
> i want to search in a m:n-relation of an object. my oql-query looks like
> that:
>
> 'SELECT o FROM mycomp.People o WHERE (firstname like $1 OR lastname like
> $1) AND ( PeopleDescription.text like $2 OR exists i in peopleindex :
> i.word like $2 )'
>
> the parser gives me an exception:
> org.exolab.castor.jdo.oql.OQLSyntaxException: An incorrect token type was
> found near i (2, need 26
> at org.exolab.castor.jdo.oql.Parser.match(Parser.java:144)
>
> whats wrong with this query?
> how could i search in values of m:n-related objects?
>
> i hope somebody can help me.
>
> greetings
> jan
>
> the mapping looks like that:
> <mapping>
> <class name="mycomp.People"
> identity="id" key-generator="MAX">
> <map-to table="people"/>
> <field name="id" type="java.lang.Integer" >
> <sql name="id" type="integer"/>
> </field>
> (...)
> <field name="PeopleDescription" type="mycomp.PeopleDescription">
> <sql name="to_people_description" />
> </field>
> <field name="peopleindex" type="mycomp.PeopleIndex"
> collection="collection">
> <sql name="indexid"
> many-table="people_x_index"
>many-key="peopleid" />
> </field>
> </class>
>
> <class name="mycomp.PeopleIndex"
> identity="id" key-generator="MAX">
> <map-to table="people_index"/>
> <field name="id" type="integer" >
> <sql name="id" type="integer"/>
> </field>
> <field name="word" type="string">
> <sql name="word" type="char" dirty="check" />
> </field>
> <field name="people" type="com.gate5.people.lg.People"
> collection="collection">
> <sql name="peopleid"
> many-table="people_x_index"
>many-key="indexid" />
> </field>
> </class>
>
> <class name="mycomp.PeopleDescription"
> identity="id" key-generator="MAX">
> <map-to table="people_description"/>
> <field name="id" type="java.lang.Integer" >
> <sql name="id" type="integer"/>
> </field>
> <field name="People" type="mycomp.People">
> <sql name="to_people"/>
> </field>
> (...)
> <field name="imgdata" type="bytes">
> <sql name="imgdata" type="blob"/>
> </field>
> </class>
> </mapping>
>
> -----------------------------------------------------------
> 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