• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Recursive Tree Problem...

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....


 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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