title: TIMESTAMP in NamedNativeQuery using Spring Data JPA
body: <p>The scenario is to fetch values from OracleDB where one of the search input is DateTime in the format <strong>"07/11/2017 10:12:16 AM"</strong> (which is a string) and the DB Column is TIMESTAMP.</p>
  
  <p>The Data in the column is saved in the format <strong>"07/11/2017 10:12:16 AM"</strong> but it is a TIMESTAMP.</p>
  
  <p>while querying from the Oracle DB, it is possible to convert the search input to the appropriate TIMESTAMP using <strong>TO_TIMESTAMP</strong> function </p>
  
  <p>Example 
  <code>select * from Table where SI_ID='12345'and COLUMN &gt;= TO_TIMESTAMP ('07/11/2017 10:12:16 AM', 'mm/DD/YYYY HH:MI:SS AM'</code>;</p>
  
  <hr>
  
  <p>I need to achieve the same in Java using Spring Data JPA and NamedQuery.
  The NativeNamedQuery is called from the JPA repository is as follows</p>
  
  <pre><code>@Query(name = "Sample.findRecordByIdAndTime", nativeQuery = true)
   Sample findByIdAndTime (@Param("id") Long id, @Param("timestamp") String timestamp);
  </code></pre>
  
  <hr>
  
  <p>But how to convert the string to TIMESTAMP in the Named query called from JPA repository which is given below:</p>
  
  <pre><code>@NamedNativeQuery(name="Sample.findRecordByIdAndTime", query="select * from TABLE where SI_ID= ? and TS_COLUMN &gt;= TO_TIMESTAMP(?, 'mm/DD/YYYY HH:MI:SS AM')", resultClass = Sample.class)
  </code></pre>
  
  <p>Any help will be appreciated.</p>