title: Issue with using timestamp field in named query
body: <p>I am working on Eclipselink named query and have issues in setting optional parameter for timestamp.</p>
  
  <p>My requirement is to query data with timestamp if the field is entered by the user. As the field is optional, I am checking for ''0000-00-00 00:00:00' or the user input date. The query snippet is as follows. However it doesn't work. </p>
  
  <pre><code>DataConstants.java
  ==================
  public static String DATE_CHECKING_FORMAT = "0000-00-00 00:00:00"
  
  Named Query
  ===========
  entityManager.createNamedQuery("Requests.SearchAllData")
  .setParameter("fromTime", ((selectionCriteria.getFromRequestTime() == null)? DataConstants.DATE_CHECKING_FORMAT : selectionCriteria.getFromRequestTime()))
  .setFirstResult(offset).setMaxResults(limit).getResultList();
  
  @NamedQuery(name = "Requests.SearchAllData", 
     query = "select ws.requestTimeStamp from StudentBE ws where ((:fromTime = to_timestamp('0000-00-00 00:00:00','dd-mm-yyyy hh24:mi:ss')) or (ws.requestTimeStamp &gt;= :fromTime))), 
  </code></pre>
  
  <p>While executing, I am getting this error.</p>
  
  <p>Exception Description: Syntax error parsing the query [Requests.SearchAllData: select ws.requestTimeStamp from StudentBE ws where ((:fromTime = to_timestamp('0000-00-00 00:00:00','dd-mm-yyyy hh24:mi:ss')) or (ws.requestTimeStamp >= :fromTime)), line 1, column 63: syntax error at [=].
  Internal Exception: MismatchedTokenException(82!=84)</p>
  
  <p>Please suggest how to use optional timestamp field.</p>
  
  <p>Thanks!!!</p>