title: How can I create data structure in java having records from 3 tables?
body: <p>How can I create data structure in java having records from 3 tables?</p>
  
  <h2>Query/ Total number of records.</h2>
  
  <pre><code>select * from TRANSACTION where workitemid = '104854'; (1 Record)
  select * from WHT where workitemid = '104854'; (1 Record)
  select * from FX where workitemid = '104854'; (2 Record)
  </code></pre>
  
  <h2>Data structure in JAVA.</h2>
  
  <pre><code>PSRResponseReportDTO{
      String workitemid;
  
      public PSRResponseReportDTO() {
          this.fxDetail = new HashSet&lt;PSRResponseReportDTO&gt;();        
          this.whtDetails = new HashSet&lt;PSRResponseReportDTO&gt;();
          this.invoiceDetails = new HashSet&lt;PSRResponseReportDTO&gt;();
      }
  }
  </code></pre>
  
  <h2>Query</h2>
  
  <pre><code>select ptw.workitemid
         , pttd.workitemid   as PAY_TXN_TAX_DETAILS_WORK_ID 
         , ptsi.workitemid   as pay_txn_supp_inf_work_id
  from TRANSACTION ptw
       , WHT pttd
       , FX ptsi
  where ptw.workitemid = pttd.workitemid (+)
  AND ptw.workitemid =  ptsi.workitemid (+)
  AND ptw.workitemid = '104854'
  order by ptw.workitemid;
  </code></pre>
  
  <p>The table does not have a primary key, only a foreign key. Fallows an example of the obtained data. The question is how to identify that for for Fx there are two rows and for WHT there is one row?</p>
  
  <p>Result from query:</p>
  
  <pre><code>|  PTW   |   WHT   |   FX   | PTW.COLUMN1 | FX_COLUMN1 | WHT_COLUMN 1 |
  +--------+---------+--------+-------------+------------+--------------+
  | 104854 |  104854 | 104854 |      1      |     2      |      3       |
  | 104854 |  104854 | 104854 |      1      |     2      |      3       |
  </code></pre>