title: One to many to many for tree level view from resultSet
body: <p>I am having a result set as shown below (Pasted the Database result into excel for easy interpretation).</p>
  
  <p><a href="https://i.stack.imgur.com/KeAti.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KeAti.jpg" alt="enter image description here"></a></p>
  
  <p>This data needs to be shown in the UI as a tree level as shown in the below image.</p>
  
  <p><a href="https://i.stack.imgur.com/IqeG8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IqeG8.jpg" alt="enter image description here"></a></p>
  
  <p>So, now if the user clicks the <strong><em>First Row</em></strong> -> it will expands to the <strong><em>Data One</em></strong> and <strong><em>Data Two</em></strong>. Again, if the user clicks on the <strong><em>Data One</em></strong>, it will show the <strong><em>DataA, DataB, DataC</em></strong>. For this we have a pojo class with links. I just need to collect the data  from the resultset. How to do that logic? Please help.</p>