For example, I wrote:

     query = startQuery("SELECT p FROM jdo.Recurso p WHERE p.codigo = $1"
);
     query.bind(legajo);
     QueryResults items = query.execute();
     while (items.hasMore()) {
          return (Recurso) items.next();
     }

The query return a list of objects that I typecast to my object (Recurso =
Resource). Codigo is
the code of the resource.


______________________________________________
Ing. Gustavo Rafael Pistoia
CDA Inform�tica S.A.
TE: 4343-5200.
Int (6329) 4566.


                                                                                       
                            
                    "Martin,                                                           
                            
                    Margaret"            Para:   [EMAIL PROTECTED]                 
                            
                    <mmartin@vign        cc:                                           
                            
                    ette.com>            Asunto:      Re: [castor-dev] Query on 
dependent object value?            
                                                                                       
                            
                    14-02-02                                                           
                            
                    04:17 PM                                                           
                            
                    Por favor,                                                         
                            
                    responda a                                                         
                            
                    castor-dev                                                         
                            
                                                                                       
                            
                                                                                       
                            



OOps, I didn't see the name attribute on Product. If you look at
ProductDetails, it also contains a name field. What I really want to query
is where ProductDetail.name = 'Computer'... is this possible?

Sorry for the confusion..

Margaret

-----Original Message-----
From: Gustavo Pistoia [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 1:09 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Query on dependent object value?



You can do something like

   "SELECT p FROM jdo.Producto p WHERE p.name = 'Computer'"

And it returns an object that you have to cast to Product.

______________________________________________
Ing. Gustavo Rafael Pistoia
CDA Inform�tica S.A.
TE: 4343-5200.
Int (6329) 4566.




                    "Martin,

                    Margaret"            Para:   [EMAIL PROTECTED]

                    <mmartin@vign        cc:

                    ette.com>            Asunto:      [castor-dev] Query on
dependent object value?


                    14-02-02

                    03:54 PM

                    Por favor,

                    responda a

                    castor-dev








Hey all,
Is it possible to query for all of the instances of some object where a
contained object has a particular value? For instance, in the Product
example, I would like to query for all of the Products which have specific
value for name.... I've tried a few things, but I can't even come up with
OQL that will pass the parser. On that note, does anyone have pointers to
any good OQL resources?


Thanks for your help -
Margaret

-----------------------------------------------------------
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

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to