Re: [ojb-users] OQL Syntax (newbie)
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2002-06-06 17:24:54
|
Hi Lorenzo, Lorenzo Nicora wrote: > Hello, > > I've a newbie question on OQL syntax support in OJB. > I'm running some personal tests with OJB 0.9 after successfully > running all junit tests and tutorials. For OQL, I'm referring to the > ODMG 3.0 "bible" paper book (actually not very useful as a > "user"...). > > If I run a simple OQL query using aliases like this: > > select c from test.Client c where c.id = $1 > > I get a parsing error calling oqlQuery.create(...): > > line 1: unexpected token: c > java.lang.NullPointerException > ojb.odmg.OQLQueryImpl.create(OQLQueryImpl.java:178) > > I tried unsuccessfully many "permutations" :-) of the query sintax. > Running the same OQL without alias works! > > select c from test.Client where id = $1 > > > My questions are: > Am I doing some mistake? > and: > What is the level of support and compliance of ODMG 3.0 OQL in > OJB? Hi our OQL parser is based on an ANTLR grammar from the official odmg site. We support the same syntax, but use the parser to build up ojb.broker.query.Criteria objects. Thus if an OQL statement can not be parsed it must be a problem with the original oql.g. There are only a few things like aggregation functions that are not supported. The best thing to see what OJB will generate from you OQL statement is to have a look at our oql-ojb.g (to be found under src/java/ojb/odmg/oql). Thomas > > I browsed the documentation and many of the examples, but > almost all OQL examples I've seen are rather "basic". > > Thanks > > Lorenzo > > WEBPLAN srl > v.Civerchio 4 > 20159 MILANO - ITALY > tel. +39-02-69311782 > fax. +39-02-60857392 > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > |