Actually, I think he meant his query to be something more like...

SELECT a.id
FROM table_a a
INNER JOIN table_a b ON a.col2 = b.col3
WHERE a.col1 = x AND b.col2 = y

-----Original Message-----
From: John McNally [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 12:31 PM
To: Turbine Users List
Subject: Re: Criteria table joins on the same table


I do not see a "self join" here, it looks like a standard query that is
handled well by Criteria

crit.add(APeer.COL1, someVal);
crit.addJoin(APeer.COL2, BPeer.COL2);
crit.add(BPeer.ID, anotherVal);

why is the alias even needed?

john mcnally

On Tue, 2002-05-21 at 19:38, George Papastamatopoulos wrote:
> Hi
> I have a query that looks like this
> 
> 
> SELECT A.ID FROM
> TABLE A A, TABLE B
> WHERE (A.col_1 = some_value) AND
> (
>   (A.col_2 = B.col_2) AND
>   (
>     (B.id = another_value)
>   )
> )
> 
> I'm having trouble representing this using Criteria objects. Does anyone
> know if this is possible, if so could you point me in the right direction?
> 
> Thanks
> George Papastamatopoulos
> 
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> 
> 



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

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

Reply via email to