[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1395) Hierarchical entity data management using 'modified preorder tree traversal algorithm' (nested set trees)

Joonas Koivunen (JIRA) noreply at atlassian.com
Fri Dec 18 12:56:29 EST 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=34982#action_34982 ] 

Joonas Koivunen commented on HHH-1395:
--------------------------------------

I've found a problem from the update code; I'm working to reproduce and fix it, but as of yet, I cannot reproduce it even in unit tests (not included in the distribution).

I get {{org.hibernate.AssertionFailure: collection [groups.entities.Group.children] was not processed by flush()}} in the following situation:

 # open session on request (OpenSessionInView filter)
 # bind value from html <select> form post
 #* {{Session.load(Group.class, 1L);}}
 #* {{Group.setParent(boundValue);}}
 # setup transaction
 # {{Session.saveOrUpdate(modifiedGroup);}}
 #* all goes great
 # commit (implicit flush)
 #* the assertion failure

Still investigating this one. But as discussed with Steve Ebersole at irc, he feels that a new kind of persister might be the best solution for Nested Set datatypes.

I'm yet to discuss this with Christian Bauer..

> Hierarchical entity data management using  'modified preorder tree traversal algorithm' (nested set trees)
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-1395
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1395
>             Project: Hibernate Core
>          Issue Type: New Feature
>          Components: core, query-hql
>         Environment: Hibernate 3.1 plus Annotations extending EJB3 implementation
>            Reporter: James Salt
>         Attachments: nestedset.tar.gz, utils-parent-20091117.tar.gz
>
>   Original Estimate: 3 weeks
>  Remaining Estimate: 3 weeks
>
> An enhancement to allow entities to exist in a managed tree (DAG) structure, via the use of property annotations and entity annotations. With an extension to the HQL language to mimic the Oracle recusive query clause. 
> This would be classically be useful for Bill of Material uses, or any tree like entity structure. 
> I have implemented a homebrew approach using the 'adjacency list method' , and a post persist call back method to set the node path. Although I think a more full blown optimised algorithm would be the 'modified preorder tree traversal algorithm'. 
> In the annotations world this could be implemented using an annotation like @Hierarchical to the entity, with a @Parent (mask for @ManyToOne) annotation on the parent field/parameter and @Children (mask for @OneToMany) annotation on the list of children entities. 
> Then a postupdate method could be implemented for the entity type, that recalculates the tree meta data -i.e. parent, left and right. 
> I believe this would be a valuable extension (useful for many common data models) to the hibernate core product that could be exposed through annotations as I have discussed and the hbm.xml. 
> The users of such a system would be aware of the performance implications on insert/update/delete, but gain a massive performance gain on querying a tree data model. 
>   

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list