First of all, form your question it is not clear if you need help on SQL side or java data structure side.
I assume both i.e. you need to fetch data from database & then populate in appropriate java data structure.
So there is no direct way for this. Your data is mainly TREE STRUCTURE, so mainly you need to focus on java data structure for tree. So below are the steps that you need to take.
1) First create java class structure for tree structure. Refer below links for that.
Java tree data-structure?
http://www.java2s.com/Code/Java/Collections-Data-Structure/Yourowntreewithgenericuserobject.htm
http://www.codeproject.com/Articles/14799/Populating-a-TreeView-Control-from-the-Database
2) Then you don't need much from sql side if you finally need java objects. SO you can do plain select query to fetch data.
3) Now you need to have a helper method for preparing tree for you data using class structure form step 1. If you do better design, you tree class structure can be made self constructing using SQL data.