Without extra support mechanisms, there is no way to do this in HQL. But of
course you can use a CTE/SQL query in NH directly.

If you think that's a big no no, the possible support mechanisms are:

-Maintaining a full list of ancestors/descendants on each folder (as
outlined in Ayende's post)
-Maintaining a "materialized path" on each folder. Can be done in the entity
layer or using triggers on the DBMS.
-Maintaining "nested set" values on the entities. Really advanced but also
very efficient.

/G

2011/6/15 raffaeu <[email protected]>

> I have found these two options
> Common table expression with SQL
>
>
> http://refactoringaspnet.blogspot.com/2011/04/using-common-table-expressions-to.html
>
> or with NHibernate HQL
>
> http://nhibernate.hibernatingrhinos.com/16/how-to-map-a-tree-in-nhibernate
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to