You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by jefferson chaves gomes <je...@amhpdf.com.br> on 2005/04/20 20:55:18 UTC

Fw: OJB queries.....

----- Original Message ----- 
From: jefferson chaves gomes 
To: OJB Ajuda 
Sent: Wednesday, April 20, 2005 3:48 PM
Subject: OJB queries.....


 Hi, I'm from Brazil, then it forgives my English, I want to use OJB and divulge it in Brazil, but I have a problem ......

   How I can do a querie with more than one table.
   For example(this example was removed of your site OK):

I know that this reply it is in the site: http://db.apache.org/ojb/docu/guides, but I am not understanding.
Please, you can say me as to make this example below since the beginning, or either,
with the mapping of the archive repository_database.xml and  the necessary classes .java for I make it  ?????


SELECT DISTINCT A0.ID, A1.VALUEFROM CONTAINER A0 INNER JOIN ABSTRACT_ATTRIBUTE A1     ON A0.ID=A1.REF_ID     INNER JOIN ABSTRACT_ATTRIBUTE A2     ON A0.ID=A2.REF_ID     INNER JOIN ABSTRACT_ATTRIBUTE A3     ON A0.ID=A3.REF_IDWHERE (( A0.NAME =  'companyName' ) AND  (A0.VALUE =  'iBanx' )) AND      (( A1.NAME =  'contactPerson' ) AND  (A1.VALUE LIKE '%janssen%' )) AND      (( A2.NAME =  'size' ) AND  (A2.VALUE =  '500' ))
 My main doubt is: How to work with more than with one table ?
 This because to use one table in the querie for me is not problem OK?
 Please, help me to learn and to divulge this framework here in Brazil
-- 
Jefferson Chaves 

Re: Fw: OJB queries.....

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi jefferson,

ojb will automatically join the two tables if you define a relationship 
between them in repository.xml.

http://db.apache.org/ojb/docu/guides/query.html
http://db.apache.org/ojb/docu/guides/query.html#joins

jakob

jefferson chaves gomes schrieb:
> ----- Original Message ----- 
> From: jefferson chaves gomes 
> To: OJB Ajuda 
> Sent: Wednesday, April 20, 2005 3:48 PM
> Subject: OJB queries.....
> 
> 
>  Hi, I'm from Brazil, then it forgives my English, I want to use OJB and divulge it in Brazil, but I have a problem ......
> 
>    How I can do a querie with more than one table.
>    For example(this example was removed of your site OK):
> 
> I know that this reply it is in the site: http://db.apache.org/ojb/docu/guides, but I am not understanding.
> Please, you can say me as to make this example below since the beginning, or either,
> with the mapping of the archive repository_database.xml and  the necessary classes .java for I make it  ?????
> 
> 
> SELECT DISTINCT A0.ID, A1.VALUEFROM CONTAINER A0 INNER JOIN ABSTRACT_ATTRIBUTE A1     ON A0.ID=A1.REF_ID     INNER JOIN ABSTRACT_ATTRIBUTE A2     ON A0.ID=A2.REF_ID     INNER JOIN ABSTRACT_ATTRIBUTE A3     ON A0.ID=A3.REF_IDWHERE (( A0.NAME =  'companyName' ) AND  (A0.VALUE =  'iBanx' )) AND      (( A1.NAME =  'contactPerson' ) AND  (A1.VALUE LIKE '%janssen%' )) AND      (( A2.NAME =  'size' ) AND  (A2.VALUE =  '500' ))
>  My main doubt is: How to work with more than with one table ?
>  This because to use one table in the querie for me is not problem OK?
>  Please, help me to learn and to divulge this framework here in Brazil

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