Hi;

FYI The proxy in the documentation isn't at all relevant.

Oh, and you haven't attached the files !

Cheers,

Charles.

>-----Original Message-----
>From: Joseph Campbell [mailto:[EMAIL PROTECTED]]
>Sent: 18 September 2002 15:59
>To: OJB Users List
>Subject: Re: need a good join example... PLEASE HELP.
>
>
>Charles,
>       It helps a little, but I note the use of proxy in the 
>example you give.  I am 
>enclosing the xml descriptor for my tables, and the two java 
>classes in 
>question.  In the hopes these will help.
>
>What I am looking for is the Collection of Base Class Report 
>Objects for the 
>Given treeId and nodeId as listed by query in one or more 
>TreeNodeReport 
>Objects.  
>
>Thanks in advance,
>       Joe
>
>PS: Sorry for being a newbie on this one...
>
>On Wednesday 18 September 2002 10:26 am, Charles Anthony wrote:
>> Hi Joseph,
>>
>> The design of your tables won't really help us to help you here.
>>
>> OJB is an Object-To-DB-mapping framework; your queries 
>will/should (99% of
>> the time) be based on objects.
>>
>> There is a section on the query
>> document(http://jakarta.apache.org/ojb/query.html) that 
>discusses joins.
>> Unfortunately, on the apache site the document hasn't been 
>transformend
>> correctly. Here follows the XML source of the documentation. 
>I hope this
>> helps a bit.
>>
>> Cheers,
>>
>> Charles.
>>
>> <subsection name="joins">
>> <p>
>> Joins resulting from path expressions ("relationship.attribute") in
>> criteria are automatically handled by OJB.
>> Path expressions are supported for all relationships 1:1, 1:n and m:n
>> (decomposed and non-decomposed)
>> and can be nested.
>> <br/><br/>
>> The following sample looks for all articles belonging to the 
>product group
>> "Liquors".
>> Article and product group are linked by the relationship 
>"productGroup" in
>> class Article:
>>
>> <source><![CDATA[
>> <!-- Definitions for org.apache.ojb.ojb.broker.Article -->
>>    <class-descriptor
>>        class="org.apache.ojb.broker.Article"
>>        proxy="dynamic"
>>        table="Artikel"
>>
>>       ...
>>       <reference-descriptor
>>          name="productGroup"
>>          class-ref="org.apache.ojb.broker.ProductGroup"
>>
>>          <foreignkey field-id-ref="4"/>
>>       </reference-descriptor>
>>    </class-descriptor>
>>
>>    <class-descriptor
>>        class="org.apache.ojb.broker.ProductGroup"
>>        proxy="org.apache.ojb.broker.ProductGroupProxy"
>>        table="Kategorien"
>>
>>        ...
>>       <field-descriptor id="2"
>>          name="groupName"
>>          column="KategorieName"
>>          jdbc-type="VARCHAR"
>>       />
>>       ...
>>    </class-descriptor>
>> ]]></source>
>>
>> <br/>
>> The path expression includes the 1:1 relationship 
>"productGroup" and the
>> attribute "groupName":
>>
>> <source><![CDATA[
>>   Criteria crit = new Criteria();
>>   crit.addEqualTo("productGroup.groupName", "Liquors");
>>   Query q = QueryFactory.newQuery(Article.class, crit);
>>
>>   Collection results = broker.getCollectionByQuery(q);
>> ]]></source>
>>
>> </p>
>> </subsection>
>>
>> >-----Original Message-----
>>
>> From: Joseph Campbell [mailto:[EMAIL PROTECTED]]
>>
>> >Sent: 18 September 2002 15:25
>> >To: [EMAIL PROTECTED]
>> >Subject: need a good join example... PLEASE HELP.
>> >
>> >
>> >This may have been answered elsewhere but I am unable to locate it:
>> >
>> >I am in need of an example for a join query.  Here is the
>> >situation... two
>> >tables that look like this....
>> >
>> >CREATE TABLE one (
>> >keyid       int not null,
>> >blah1       char(10),
>> >blah2       char(10),
>> >blah3       char(10)
>> >) PK = keyid;
>> >
>> >CREATE TABLE two (
>> >fkid        int not null,
>> >key1        int not null,
>> >key2        int not null
>> >) PK = fkid, key1, key2, FK = fkid -> one(keyid)
>> >
>> >I am trying to get the collection of table one Objects for a
>> >given table
>> >two(key1, key2) combination.  I think I have the XML
>> >descriptors set up right
>> >but am not sure.  I have searched the website for an exmaple
>> >of java code
>> >with the XML descriptor that I can model after - but have as
>> >yet been unable
>> >to find one.  Can anyone help with a small snip of what this
>> >looks like?  Or
>> >maybe its in a page I just have not read yet and you can
>> >forward me to the
>> >URL?
>> >
>> >Thanks,
>> >    Joe Campbell
>> >--
>> >You laugh at me because I am different,
>> >I laugh at you because you are the same.
>> >-----------------------------------------------------
>> >Joseph Campbell      | EMAIL: [EMAIL PROTECTED]
>> >Staff Consultant     | URL:   www.inventa.com
>> >Inventa Technologies | PH:    (856)914-5200
>> >
>> >                     | PGER:  (888)454-0876
>> >
>> >-----------------------------------------------------
>> >
>> >
>> >--
>> >To unsubscribe, e-mail:
>>
>> <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail: 
<mailto:[EMAIL PROTECTED]>
>
>
> This email and any attachments are strictly confidential and are intended
> solely for the addressee. If you are not the intended recipient you must
> not disclose, forward, copy or take any action in reliance on this message
> or its attachments. If you have received this email in error please notify
> the sender as soon as possible and delete it from your computer systems.
> Any views or opinions presented are solely those of the author and do not
> necessarily reflect those of HPD Software Limited or its affiliates.
>
>  At present the integrity of email across the internet cannot be
guaranteed
> and messages sent via this medium are potentially at risk.  All liability
> is excluded to the extent permitted by law for any claims arising as a re-
> sult of the use of this medium to transmit information by or to
> HPD Software Limited or its affiliates.

-- 
You laugh at me because I am different,
I laugh at you because you are the same.
-----------------------------------------------------
Joseph Campbell      | EMAIL: [EMAIL PROTECTED]
Staff Consultant     | URL:   www.inventa.com
Inventa Technologies | PH:    (856)914-5200
                     | PGER:  (888)454-0876
-----------------------------------------------------


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.

 At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk.  All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to 
HPD Software Limited or its affiliates.



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to