title: How to retrieve hierarchical items in one go from SQL table in any java structure for comparison?
body: <p>I want to read items from SQL table which are in Hierarchical manner. e.g. My table having Parent-Child relations.
  Following is my table structure:</p>
  
  <pre><code>id    name    parentId
  
  1     abc      null
  
  2     xyz        1
  
  3     lmn        1
  
  4     qwe       null
  
  5     asd        4
  </code></pre>
  
  <p>So I want to load all the Item hierarchically in one go, How can I do that?
  I tried HashMap but it feels very complex....
  thanks in advance...</p>