title: Spring: InvalidDataAccessApiUsageException?
body: <p>I am getting the following exception:</p>
  
  <pre><code>org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value did not match expected type. [java.util.Date (n/a)]; 
  nested exception is java.lang.IllegalArgumentException: Parameter value did not match expected type [java.util.Date (n/a)]
  </code></pre>
  
  <p>Here is my query method in my repository:</p>
  
  <pre><code> @Query("SELECT COUNT(entity) FROM Person entity WHERE trunc(entity.date) BETWEEN :startTime AND :endTime")
   int getPersonBetweenDates(@Param("startTime") DateTime var1, @Param("endTime") DateTime var2);
  </code></pre>
  
  <p>And my implementation in component:</p>
  
  <pre><code> int totalPersons = personRepo.getPersonBetweenDates(new DateTime().withTimeAtStartOfDay(), DateTime.now());
  </code></pre>
  
  <p>Why am I getting this error? It seems that the two <strong>DateTime</strong> parameters in the implementation match those in my method?</p>