title: Order by multiple columns in hibernate criteria
body: <p>I have a table like below</p>
  
  <pre><code>    ID      creationDate        startDate       status      
      1       10-08-2019 08:00    10-08-2019 08:00    1   
      2       10-08-2019 07:00    10-08-2019 08:00    2
      3       10-08-2019 09:00    10-08-2019 08:00    2
      4       10-08-2019 08:00    10-08-2019 10:00    1
      5       10-08-2019 11:00    10-08-2019 08:00    2
  </code></pre>
  
  <p>I have written a code like below to fetch data by considering both dates and status. Finally I want to sort the result <strong>by both creationDate and startDate</strong> .</p>
  
  <p>from = 09-08-2019 08:00</p>
  
  <p>to = 11-08-2019 08:00</p>
  
  <pre><code>Disjunction disjunction = Restrictions.disjunction();
  Conjunction creationDateConjunction = Restrictions.conjunction(); 
  creationDateConjunction.add(Restrictions.in("status", 2));
  creationDateConjunction.add(between("creationDate", from, to));
  
  Conjunction startDateConjunction = Restrictions.conjunction();
  startDateConjunction.add(Restrictions.in("status",1));
  startDateConjunction.add(between("startDate", from, to));
  
  disjunction.add(creationDateConjunction);
  disjunction.add(startDateConjunction);
  criteria.add(disjunction);
  criteria.addOrder(Order.asc("creationDate"));
  criteria.addOrder(Order.asc("startDate"));
  </code></pre>
  
  <p>I am getting results (IDs) as 
  <strong>2,3,5,1,4</strong> (First order by createDate then startDate)</p>
  
  <p>But I want to get 
  <strong>2,1,3,4,5</strong> (As time getting increase)</p>
  
  <p>Can some one help me to write a query to get correct order </p>