title: EclipseLink jpql "where clause" comparing timestamp is not working as expected
body: <p>My jpql <strong>"where clause"</strong> that selects using a timestamp column does not "filter" as expected.  </p>
  
  <p>It appears sensitive to the "date" portion of the timestamp, but, ignores the "time" portion.</p>
  
  <p>The table1.tmstmp column is defined as:  "TMSTMP TIMESTAMP NOT NULL"</p>
  
  <p>The table1 entity contains the following named query...</p>
  
  <pre><code>@NamedQuery(name = "table1.getUpdTime", query = "SELECT e FROM table1 e     
  WHERE e.tmstmp &gt;= :tmstmp order by e.tmstmp asc")
  </code></pre>
  
  <p>The tmstmp property is defined like this...</p>
  
  <pre><code>@Column(name = "TMSTMP", nullable = false)
  private Timestamp tmstmp;
  </code></pre>
  
  <p>It is used like this...</p>
  
  <pre><code>TypedQuery&lt;EsEvnt&gt; query = em.createNamedQuery("table1.getUpdTime",
  table1.class).setParameter("tmstmp", tmstmp); 
  </code></pre>
  
  <p>For example, when the Timestamp variable ("tmstmp"), above, is equal to "2016-06-30T09:28:33.247-04:00", it returns all records where the date portion is:  2016-06-30.</p>
  
  <p>Any ideas?</p>
  
  <p>I'd like to depend upon the "where clause" to explicitly select using the entire timestamp.</p>
  
  <p>Thanks!</p>
  
  <p><strong><em>UPDATE</em></strong></p>
  
  <p>I modified my query (seemed a native query was required) using the "CAST" function, as shown below, and it appears to work consistently...</p>
  
  <pre><code>//...note, date is in ISO format...
  LocalDateTime ldt = LocalDateTime.parse(tmstmpString, DateTimeFormatter.ISO_DATE_TIME);
  Timestamp tmstmp = Timestamp.valueOf(ldt);
  - 
  -
  -
  // (see "native query", coded below)...
  Query query = em.createNativeQuery("SELECT * FROM table1 e WHERE e.tmstmp &gt;= CAST(?1 as TIMESTAMP)", Table1.class)  
          .setParameter(1, tmstmp);  
  List&lt;Table1&gt; resultList = query.getResultList(); 
  </code></pre>
  
  <p>Thanks! :)</p>
  
  <hr>
  
  <p>WebLogic 12.1.3</p>
  
  <p>DB2</p>
  
  <p>Java 8</p>
  
  <p>EclipseLink 2.1</p>