title: Datetime to Date (MySQL) in JPA createQuery error Exception [EclipseLink-8025]
body: <p>I'am new in JAVA and JPA.
  I use command </p>
  
  <pre><code>select * from asm.attendant where staff_no='0004' and node_code='KT1' and date(attendant_date) = '2013-05-13';
  </code></pre>
  
  <p>in MySQL it's work</p>
  
  <p>but</p>
  
  <p>when i use in JPA</p>
  
  <pre><code>    public List&lt;Attendant&gt; listAttendantByStaffNoAndNodeCodeAndDateWs(String staffNo,String nodeCode,String attendantDateData) throws ParseException {
  
      Date attendantDate = new SimpleDateFormat("yyyy-MM-dd").parse(attendantDateData);
  
      Query result =  em.createQuery("SELECT a FROM Attendant a WHERE a.staffNo = :staffNo AND a.nodeCode = :nodeCode AND DATE(a.attendantDate) = :attendantDate", Attendant.class);
      result.setParameter("staffNo", staffNo);
      result.setParameter("nodeCode", nodeCode);
      result.setParameter("attendantDate", attendantDate);
      return result.getResultList();
  }  
  </code></pre>
  
  <p>it's not work.</p>
  
  <p>error</p>
  
  <blockquote>
    <p>Caused by: Exception [EclipseLink-8025] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.JPQLException
    Exception Description: Syntax error parsing the query [SELECT a FROM Attendant a WHERE a.staffNo = :staffNo AND a.nodeCode = :nodeCode AND DATE(a.attendantDate) = :attendantDate], line 1, column 88: unexpected token [(].
    Internal Exception: NoViableAltException(83@[()* loopback of 383:9: (d= DOT right= attribute )*])</p>
  </blockquote>