Hi Maarten, 

The way I did is :

1. Get a list of all the employees that did exist through Join. (An
arraylist with keys)
2. Then I did a select of all Employees, and I used the 

        Criteria critA = new Criteria();
        critA.addNotIn(LatteUserPeer.USER_ID, listje);
        List usersA = LatteUserPeer.doSelect(critA);

So use the addNotIn with Criteria ...

If there are any other options ... I  would be interested to know !


Christoph
Brussels/Belgium
-----Original Message-----
From: Maarten Coene [mailto:[EMAIL PROTECTED]] 
Sent: Friday, June 21, 2002 2:37 PM
To: [EMAIL PROTECTED]
Subject: Help needed with creating a criteria

Hi,

I can't find out how I have to create a Criteria which executes the 
following query:

SELECT *
FROM EMPLOYEE e
WHERE NOT EXISTS (SELECT *
                                   FROM  DEPENDENT d
                                   WHERE e.PERSON_ID = d.PERSON_ID)

or in words:

I want all Employee Records where no Dependent record exists pointing to 
the Employee Record.

Can someone help me?

thanks,
Maarten

--
Maarten Coene
Katholieke Universiteit Leuven
Dept. Computerwetenschappen             Tel: ++32 (0)16/32 78 25
Celestijnenlaan 200A
B-3001 Heverlee


--
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