-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Load the whole object tree with Single Select SQL
PostPosted: Mon Nov 10, 2008 7:07 am 
Newbie

Joined: Sat Oct 25, 2008 1:05 am
Posts: 9
My requirement is generate tree menu.
I have a table with parent -child reference of same table

my mapping file :-

<class name="sample.TreeMenu" table="TISSTREEMENU" lazy="true">
<id name="menuId" type="int">
<column name="MENU_ID" />
<generator class="assigned">
</generator>
</id>
<property name="menuName" type="string">
<column name="MENU_NAME" length="10" not-null="true" />
</property>


<property name="parentMenuId" type="int">
<column name="PARENT_MENU_ID" />
</property>


<many-to-one name="parent" class="sample.TreeMenu" fetch="join" update="false" insert="false" >
<column name="PARENT_MENU_ID" />
</many-to-one>
<set name="children" inverse="true" outer-join="true">
<key>
<column name="PARENT_MENU_ID" />
</key>
<one-to-many class="sample.TreeMenu" />
</set>
</class
Could anyone suggest ,how to load whole tree menu with single SQL?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.