persistence@glassfish.java.net

Re: Having trouble with a "NOT IN" query

From: James Sutherland <jamesssss_at_yahoo.com>
Date: Mon, 10 Dec 2007 06:32:16 -0800 (PST)

What have you tried so far?

I would think this should work, "Select file from File file where
file.parentFolder is null"



Farrukh Najmi-2 wrote:
>
>
> 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
>


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.oracle.com/technology/products/ias/toplink/ Oracle TopLink , 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  https://glassfish.dev.java.net/javaee5/persistence/ TopLink
Essentials 
Wiki:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence , 
http://wiki.eclipse.org/EclipseLink EclipseLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink , 
http://www.nabble.com/java.net---glassfish-persistence-f13455.html Glassfish
Persistence 
-- 
View this message in context: http://www.nabble.com/Having-trouble-with-a-%22NOT-IN%22-query-tp14221242p14253725.html
Sent from the java.net - glassfish persistence mailing list archive at Nabble.com.