title: sort grouped rows itself in oracle Spring/JPA
body: <p>i have 'Row' table and related 'Cell' table(OneToMany).</p>
  
  <p>i have to select all rows of document. Making left join bring all cells of each row. </p>
  
  <pre><code>Row_id    Cell   
  1          1A
  1          1B
  1          1C
  1          1D
  
  2          2A
  2          2B
  2          2C
  2          2D
  </code></pre>
  
  <p>Assuming that each cell have column index with relation ,column table also exists. ( A 1st column, B second column and etc)</p>
  
  <pre><code>      A   B   C   D
  1 - [1A, 1B, 1C, 1D]
  2 - [2A, 2B, 2C, 2D]
  </code></pre>
  
  <p>if user have this document and want to sort by A column, then what is best approach in JPA/Oracle? I must order physically row groups by cell in given column index.</p>
  
  <p>For example Desc for first column</p>
  
  <pre><code>Row_id    Cell   
  
  2          2A
  2          2B
  2          2C
  2          2D
  
  1          1A
  1          1B
  1          1C
  1          1D
  </code></pre>
  
  <p>Or group by row id  and order by selected cell for given column index.</p>
  
  <p>then i have ordered row id list.but is there a guaranteed way to fetch all rows joined with cells in specified row_id order?</p>