Daniel.Rodriguez wrote:
I have a Class called Categoria (Category) that has a List of categories
(sub-categories).
I'm trying to build a HQL query that can gives me all the Categories that
are not a subcategory of another category.
In SQL is dead simple :
SELECT cat.id
FROM Categoria cat
LEFT OUTER JOIN subCategoria sc
ON cat.id != sc.padre_id
select cat
from Categoria cat, Categoria parent
where parent.id = :theParentId
and cat not in elements(parent.subCategoria);
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]