This is just an example but not documented.
 
We use it to "lazy" load objects from a collection using a set of criteria on the object itself and on the object that hold the collection (see classes provided with the CastorJDO example)
 
 OQLQuery oql;
 QueryResults results;
 
 oql = db.getOQLQuery("SELECT d FROM myapp.ProductGroup as d  where d.products.id = $1 and name like $2");
 oql.bind(productId);
 oql.bind("Group%");
 results = oql.execute();
 while (results.hasMore()) {
   group = (ProductGroup)results.next();
   writer.println("GROUP : "+group.getName());
 }
 
Note that we use the collection (d.products) as if it were the object stored in the collection
 
Hope it will help you

-----Message d'origine-----
De : VIENNE Christophe [mailto:[EMAIL PROTECTED]]
Envoy� : mercredi 3 juillet 2002 17:01
� : [EMAIL PROTECTED]
Objet : [castor-dev] Request for OQL Query examples

Hello,

 

Does anyone know where I can find examples of some more elaborate and complex OQL queries than those included in the examples of Castor?

 

Thanks in advance,

christophe

 

 

 



=========================================================================

Ce message et toutes les pi�ces jointes sont propri�t� de VALTECH et

susceptibles de contenir des informations confidentielles � l'intention

exclusive de ses destinataires. Si vous avez re�u ce message par erreur

ou si celui ci vous est parvenu incomplet ou alt�r�, merci d'en avertir

l'exp�diteur par retour.Toute utilisation, diffusion ou publication non

express�ment autoris�e par nous par �crit est strictement interdite.

--------------------------------------------------------------------------

This message and any attachments are Valtech property and may contain

iconfidential information intended solely for the addressees. If your are

not the intended recipient of this message or if you have received it

uncomplete or altered, please notify the author by replying to his e-mail

immediately. Any unauthorised use, diffusion or dissemination not

expressly authorised by us in writing is strictly prohibited.

=========================================================================

Copyright Valtech 2002



Reply via email to