title: JPA - Native @Query parameters
body: <p>I'm trying to query all rows updated in the last N (interval parameter) seconds. It seems that <em><strong>:interval</strong></em> is not being replaced making the SQL statement parse to fail</p>
  <pre><code>@Modifying
  @Query(value = &quot;SELECT * &quot; +
                 &quot;FROM status &quot; +
                 &quot;WHERE updated_at &gt;= (SYSDATE - INTERVAL ':interval' SECOND)&quot;,
         nativeQuery = true)
  List&lt;Status&gt; findLastUpdates(@Param(&quot;interval&quot;) Integer interval);
  </code></pre>
  <p>Exception:</p>
  <pre><code>Caused by: org.h2.jdbc.JdbcSQLDataException: Cannot parse &quot;INTERVAL&quot; constant &quot;:interval&quot;; SQL statement:
  SELECT * FROM status WHERE updated_at &gt;= (SYSDATE - INTERVAL ':interval' SECOND) [22007-200]
      at org.h2.message.DbException.getJdbcSQLException(DbException.java:457) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.message.DbException.getJdbcSQLException(DbException.java:429) ~[h2-1.4.200.jar:1.4.200]
  </code></pre>
  <p>(...)</p>
  <pre><code>Caused by: java.lang.NumberFormatException: For input string: &quot;:interval&quot;
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_242]
      at java.lang.Long.parseLong(Long.java:589) ~[na:1.8.0_242]
  </code></pre>
  <p>Removing the quotes that wrappers <em><strong>:interval</strong></em> just change the exception</p>
  <pre><code>org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement &quot;SELECT * FROM STATUS WHERE UPDATED_AT &gt;= (SYSDATE - INTERVAL ? SECOND[*])&quot;; expected &quot;string&quot;; SQL statement:
  SELECT * FROM status WHERE updated_at &gt;= (SYSDATE - INTERVAL ? SECOND) [42001-200]
      at org.h2.message.DbException.getJdbcSQLException(DbException.java:453)
  </code></pre>
  <p>What Am I missing here?</p>
  <p>I'm using Spring Boot 2.3.4</p>