persistence@glassfish.java.net

Having trouble with a "NOT IN" query

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Fri, 07 Dec 2007 16:30:57 -0500

I am having some trouble with what seems like a simple enough query.

My POJO model has a class Folder where a Folder has a OneToMany
relationship with another class File (familar file folder metaphor).

    * Folder HasA Set<File>
    * Folder IsA (or extends) File
    * File has a parent Folder that may be null for top level files

I want to write a query that find all top level files (that have no
parent folder).
In other words SELECT all files that are not in any Folder's set of files.

Thanks for any suggestions.

-- 
Regards,
Farrukh Najmi
Web: http://www.wellfleetsoftware.com