Jeff Schnitzer wrote:

>> From: Sam Joseph [mailto:[EMAIL PROTECTED]]
>>
>> Criteria x_crit = new Criteria();
>> x_crit.addJoin(DepartmentPeer.id,EmployeePeer.depId);
>
>
> Ah, silly me, I overlooked that. Sorry.

No worries

> But there is no way to do self-joins, is there?

I haven't tried that, although coincidentally it looked like one problem 
I was having today could be solved with a self join, although as it 
turned out, it cannot (I mean it wouldn't solve my problem).

I can imagine that a Torque self join might work and might not.  I would 
be tempted to do something like this:

x_crit.addJoin(DepartmentPeer.id,DepartmentPeer.otherId);

and see what happens - it might work.  No promises.

Right now it turns out my problem can be solved with GROUP BY and 
HAVING, which do not seem to be robustly supported by Criteria, although 
it seems like it could be done.  I'll submit a patch if I have to change 
any code to get it to work.

Let me know if the self join works.

CHEERS> SAM



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

Reply via email to