I'm trying to pass a query as a string parameter in another JPQL native query.
@Query(value = "SELECT (:query)", nativeQuery = true) BigDecimal getTotal(@Param("query") String query); So the resulting query would be something like the query below that returns me a value
SELECT (50 * (SELECT COUNT(*) FROM SOMETABLE)) but what I'm getting in return is only the string of :query parameter and not the result of the executed complete query.