OJB 1.0.4 ODMG implementation

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

OJB 1.0.4 ODMG implementation

Längerich Bernd


I just played around with ODMG and tried to execute the following OQL:


"select x from myClass where attribute is not in ( select distinct y.id from anotherClass )"


During OQLQuery q.create(oql) OJB writes a message to stderr with "unexpected token (select)" and throws an Exception:


java.lang.NoSuchMethodError: org.apache.ojb.odmg.oql.OQLParser.recover(Lantlr/RecognitionException;Lantlr/collections/impl/BitSet;)V

            at org.apache.ojb.odmg.oql.OQLParser.argList(Unknown Source)

            at org.apache.ojb.odmg.oql.OQLParser.inExpr(Unknown Source)

            at org.apache.ojb.odmg.oql.OQLParser.quantifierExpr(Unknown Source)

            at org.apache.ojb.odmg.oql.OQLParser.andExpr(Unknown Source)

            at org.apache.ojb.odmg.oql.OQLParser.orExpr(Unknown Source)

            at org.apache.ojb.odmg.oql.OQLParser.whereClause(Unknown Source)

            at org.apache.ojb.odmg.oql.OQLParser.selectQuery(Unknown Source)

            at org.apache.ojb.odmg.oql.OQLParser.buildQuery(Unknown Source)

            at org.apache.ojb.odmg.oql.OQLQueryImpl.create(Unknown Source)

            at org.apache.ojb.odmg.oql.OQLQueryImpl.create(Unknown Source)



Am I right in assuming, that OJB does not support such subqueries?


Retrieving the Collection from the subquery and then explicitely generating an not in expression does the job, however the subquery result could be quite large.


Best regards


Bernd Längerich