Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Recursive Tree Problem...

 
Sanket L Shah
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi all,

I am developing one application using hibernate and Swing.
I am having one user class.



I have given lazy = "false" in user.cfg.xml. When I run this program using void main... it works well...
now my problem is how can I iterate loop so i can get all the data in tree structure...
I wanted to display the data in Tree Structure... but not able to write correct recursive loop...
Please help me out.....

Thank you so much....


 
Jeff Storey
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sanket,

What have you tried so far? What comes to mind is iterating over each user and printing out its sub-users recursively, for example:



This assumes there are no cyclical relationships. This may not be exactly what you want, but hopefully it should help get you started.

Jeff
 
Sanket L Shah
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hey tha Jeff Storey
MY problem is solved......
Thank you so much....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic