title: JPA select query with timestamp and date fields fail to retrieve results
body: <p>I am trying to fetch records using JPA Query which has DATE and TIMESTAMP columns in WHERE clause. But somehow date and timestamp columns fail to retrieve anything from database.
  <p><strong>Code Segment:</strong></p>
  
  <pre><code>String sql = "Select F.* from FIN_TABLE F where F.COL1_NUM = :COL1 and F.COL2_TIMESTAMP =:COL2 and F.COL3_DATE =:COL3";
  Query query = JPAentityManager.createNativeQuery(sql);
  query.setParameter("COL1", 123);
  //java.sql.Timestamp:2014-10-29 12:00:00.0
  query.setParameter("COL2", new java.sql.Timestamp(new java.sql.Date(new SimpleDateFormat("MMM dd yyyy HH:mm:sssa").parse("OCT 29 2014 12:00:000AM").getTime()).getTime()));
  //java.sql.Date:2014-10-29
  query.setParameter("COL3", new java.sql.Date(new SimpleDateFormat("MMM dd yyyy HH:mm:sssa").parse("OCT 29 2014 12:00:000AM").getTime()));
  
  List&lt;FinTable&gt; result =  (List&lt;FinTable&gt;)query.getResultList();
  </code></pre>
  
  <p><b>And Data in Oracle is:</b>
  <br></p>
  
  <pre>
  COL1_NUM    COL2_TIMESTAMP                      COL3_DATE
  123         29-OCT-14 12.00.00.000000000 AM     26-Nov-14
  456         29-OCT-14 12.00.00.000000000 AM     26-Nov-14
  </pre>
  
  <p>I am originally trying to retrieve results using EntityManager.find(Class, Object), but it was also failing so i tried with createNativeQuery(), which also fails to succeed.
  My FinTable entity has these columns as Timestamp and Date.</p>
  
  <p>Please enlighten the right way. :)
  Thanks !!</p>