Skip to content
Advertisement

Bind @param in a Jpa repository native query inside single quotations

I am looking for a way to bind a given param in a native query where the value has to be inside single quotations, like so:

JavaScript

However, when I try to run this, it results in hibernate not being able to bind the timeThreshold value as it is provided inside the single quotations ”.

Does anyone know how this can be resolved?

Advertisement

Answer

The problem you are having with your native Oracle query has to do with trying to bind a value to an interval literal. You can’t do that. Instead, use the NUMTODSINTERVAL() function:

JavaScript
Advertisement