On Dec 1, 9:21 am, "Charles F. Munat" <[EMAIL PROTECTED]> wrote:
> Will do, if I figure it out. But my comment wasn't complaining. I am
> honestly mystified. Am I the only one using trees in Hibernate? Is there
> a tree library in Scala that I'm missing? What the heck does everyone
> else do? It just blows my mind.

I found someone's contribution on Hibernate JIRA for handling sets,
but it never seems to make it into core or the proper distro; it does
seem odd its not in there.

Anyway, the HQL problem I mentioned last night... I have the following
HQL, which is just a slight mod from what was in that mysql article;
effectivly I want to list all the children of a single leaf:

SELECT node.name, (COUNT(parent.name) - (sub_tree.depth + 1)) AS depth
        FROM Content AS node,
          Content AS parent,
          Content AS sub_parent,
                ( SELECT node.name, (COUNT(parent.name) - 1) AS depth
            FROM Content AS node,
            Content AS parent
            WHERE node.lft BETWEEN parent.lft AND parent.rft
            AND node.name = :leaf
            GROUP BY node.name
            ORDER BY node.lft
            ) AS sub_tree
        WHERE node.lft BETWEEN parent.lft AND parent.rft
        AND node.lft BETWEEN sub_parent.lft AND sub_parent.rft
        AND sub_parent.name = sub_tree.name
        GROUP BY node.name
        HAVING depth <= 1
        ORDER BY node.lft

However, it bombs on the sub-query in the SELECT ... FROM ...
<subquery> statement.... im guessing you guys are using "get all leaf
nodes" type queries, so what are you doing instead of this?

Cheers

Tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" 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/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to