cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank" <faro...@hotmail.com>
Subject Re: How to query a relationship
Date Thu, 15 Feb 2007 15:11:12 GMT
Here is my original query string:

String sql = "SELECT BSYDTAA.BSYPEMP.EMYLNM, BSYDTAA.BSYPEMP.EMYFNM, 
BSYDTAC.BPRPPCP.PCDEP4, BSYDTAC.BPRPPCP.PCLDDS, BSYDTAA.BSYPEMP.EMEMP# AS 
EMEMP, BSYDTAA.BSYPEMP.EMWPH# AS WPHONE FROM BSYDTAA.BSYPEMP, 
BSYDTAC.BPRPPCP WHERE BSYDTAA.BSYPEMP.EMHSP# = BSYDTAC.BPRPPCP.PCHSP# AND 
BSYDTAA.BSYPEMP.EMDEP4 = BSYDTAC.BPRPPCP.PCDEP4 AND (BSYDTAA.BSYPEMP.EMHSP# 
IN (1,5)) AND (BSYDTAA.BSYPEMP.EMDOT=0)";

sql += " AND EMYLNM like ?";

sql += " AND EMYFNM like ?";

sql += " ORDER BY EMYLNM";



Thanks

Frank

----- Original Message ----- 
From: "Michael Gentry" <blacknext@gmail.com>
To: <user@cayenne.apache.org>
Sent: Thursday, February 15, 2007 10:06 AM
Subject: Re: How to query a relationship


> When you were using JDBC, did you have something like a right outer
> join?  (An optional relationship?)
>
> /dev/mrg
>
>
> On 2/15/07, Frank <farocco@hotmail.com> wrote:
>> Hi Michael,
>>
>> I looked at your tutorial in motion, (it has hellped me understand 
>> cayenne
>> better)
>> and have tried setting one to many on the department table.
>>
>> It still fails trying to query department # = 0 and hsp#=5
>> because there is no match in th erelated table.
>>
>> Should I just filter out records where department # is 0?
>> I did not have this problem when I did a jdbc join prior to using 
>> cayenne.
>>
>> I am kinda lost at how to resolve this.
>>
>> Regards,
>>
>> Frank
>>
>>
> 


Mime
View raw message