db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <to...@first.fhg.de>
Subject Re: OQL grammar changes
Date Fri, 02 Jul 2004 06:37:34 GMT
Clóvis Wichoski wrote:

> for object retrieval we can use the follow ideia, Think in Collections 
> of Objects that the referenced objects can't had no one interface or 
> superclass in common, (think in a Vector with Person, Article, Build, 
> Invoice ) then only solution for this is to had a single field point to 
> OID for that objects and on a secondary call load this objects, 
> programatically or in future can be done by an OQL like this:
> 
> SELECT car FROM myproject.Invoice invoice, myproject.Car car WHERE 
> invoice.myItem.myObjectOid = car.oid AND invoice.date BETWEEN 
> "2004-05-01" AND "2004-05-31"
> 
> or better to return only invoices for Cars
> 
> SELECT invoice FROM myproject.Invoice invoice, myproject.Car car WHERE 
> invoice.myItem.myObjectOid = car.oid AND invoice.date BETWEEN 
> "2004-05-01" AND "2004-05-31"
> 
> myObjectOid is only a field that maintains the OID for car, on the WHERE 
> we put the JOIN,
> 
> this maybe used too, when we need return a referenced object but don't 
> need the referer to know all about this reference. (note lazy don't 
> apply here because if I need to serialize the Invoice but don't need to 
> send whole car object, but we know that for this problem as many ways to 
> solve).
> 
> but the reality here I usually load objects needed in a second call. for 
> fields that only points to OID here are called Indirect Reference.

If I'm not mistaken, its the OQL equivalent of SQL joins, which is a 
quite a bit more involving. But you're right, it is necessary for full 
OQL3 compatibility.

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message