title: Spring Sorting with Nulls_Last Handling not working
body: <p>I created a sort rule like this for sorting my list: </p>
  
  <pre><code>Sort sort = new Sort(new Sort.Order(Sort.Direction.ASC,"productOrder", Sort.NullHandling.NULLS_LAST), new Sort.Order(Sort.Direction.ASC,"producedYear", Sort.NullHandling.NULLS_LAST));
  </code></pre>
  
  <p>with this rule I want to sort the <code>productOrder</code> first, and then if the <code>productOrder</code> is the same then the <code>producedYear</code> will be compared and sorted. If there are <strong>null values</strong> presented, it should be sorted at the end of the list. <code>productOrder</code> will have type Long and <code>producedYear</code> will have type Double. </p>
  
  <p>My Repository interface extends the JpaRepository:</p>
  
  <pre><code> public interface ProductRepository extends JpaRepository&lt;Product, String&gt; {
  
      List&lt;Product&gt; findByDisabledAndValid(int disabled, int valid, Sort sort);
  }
  </code></pre>
  
  <p>But the sorted list I received is containing the <strong>null values</strong> always at the <strong>beginning</strong> of the list. This means the <strong>null values</strong> will be sorted first, then come the <code>productOrder</code>, and finally the <code>producedYear</code> will be sorted. It seems that the <strong>third parameter</strong> that I defined on my <strong>Sort.Order</strong> method is not working. </p>
  
  <p>Does anyone have an idea why? Thank you very much</p>