title: MySQL LocalDate is being passed as String in JPA Native Query
body: <p>I am passing a LocalDate in a JPA native query. But it is taking it as String and executing.</p>
  
  <p>I get a different result when I execute the same query in MySql Workbench and from Java using the native query.</p>
  
  
  
  <ul>
  <li><p>In MySQL Workbench:</p>
  
  <pre class="lang-sql prettyprint-override"><code>select sum(expense_amount) from budgetreferee.br_expense 
  where household_id=1 and next_due_date between 2018-08-01 and 2019-07-31 
    and category_id IN(41,51,58,70,74,83,94,2,20,10,9,22,28) OR 
      is_bill=TRUE and expense_id IS NOT NULL;
  </code></pre>
  
  <p>The result is: 58171.00</p></li>
  <li><p>Using the native query:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Query(value = "select sum(expense_amount) from br_expense where household_id=:householdId and next_due_date between str_to_date(:startDate,'%Y-%m-%d') and str_to_date(:endDate,'%Y-%m-%d') and category_id IN(41,51,58,70,74,83,94,2,20,10,9,22,28) OR is_bill=TRUE and expense_id IS NOT NULL;",nativeQuery = true)
  BigDecimal getTotalExpenseAmount(@Param("householdId") Long householdId, @Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate)
  </code></pre>
  
  <p>That results in this query:</p>
  
  <pre class="lang-sql prettyprint-override"><code>select sum(expense_amount) from budgetreferee.br_expense 
  where household_id=1 and next_due_date between str_to_date
   ('2018-08-01','%Y- %m-%d') 
     and str_to_date('2019-07-31','%Y-%m-%d') and 
      category_id IN(41,51,58,70,74,83,94,2,20,10,9,22,28) OR is_bill=TRUE 
    and expense_id IS NOT NULL;
  </code></pre>
  
  <p>The result is 109871.00</p></li>
  </ul>
  
  <p>How can I resolve this discrepancy?
  I want 58171.00 to be the output when I execute it from Java.</p>