jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Scheidegger <willscheideg...@mac.com>
Subject SQL query questions: all nodes which do not have certain subnodes
Date Sun, 29 Jun 2008 10:28:37 GMT
I've got a node structure like this

- path
	- to
		- my
			- productCategories
				- category1
				- category2
					- superCategories
						- 0 = category1
				- category3
					- superCategories
						- 0 = category1
				- category4
					- superCategories
						- 0 = category2
						- 1 = cagegory3
				- category5

As you can see, a category can have references to multiple  
superCategories. Now I would like to get all "top level"  
productcategories, i.e. all product categories with no supercategories  
assigned (= category1 and category5 in my sample above). Strange  
enough finding all categories which do have a super category assign  
works fine:

select * from nt:base where superCategories IS NOT NULL

The oposit does not work:

select * from nt:base where superCategories IS NULL

lists all product categories! Strange to me, but maybe one of you has  
a good explanation or even better: A solution to my problem? And to  
make it a bit more difficult: This node should also be found by the  

- category6
	- superCategories

(i.e. a node with a subnode "superCategories", but this node does not  
contain any references).

Thanks for the help!

View raw message