nHibernate: Query tree nodes where self or ancestor matches condition

Posted by Famous Nerd on Stack Overflow See other posts from Stack Overflow or by Famous Nerd
Published on 2010-05-20T19:47:22Z Indexed on 2010/05/20 19:50 UTC
Read the original article Hit count: 306

I have see a lot of competing theories about hierarchical queries in fluent-nHibernate or even basic nHibernate and how they're a difficult beast.

Does anyone have any knowledge of good resources on the subject. I find myself needing to do queries similar to: (using a file system analog)

select folderObjects from folders where folder.Permissions includes :myPermissionLevel or [any of my ancestors] includes :myPermissionLevel

This is a one to many tree, no node has multiple parents.

I'm not sure how to describe this in nHibernate specific terms or, even sql-terms. I've seen the phrase "nested sets" mentioned, is this applicable? I'm not sure.

Can anyone offer any advice on approaches to writing this sort of nHibernate query?

© Stack Overflow or respective owner

Related posts about fluent-nhibernate

Related posts about nhibernate