Reputation: 1694
I have an interface extending JpaRepository
containing this update query defined like that:
@Modifying
@Query("UPDATE configuration SET id = replace(id, ?1, ?2) WHERE id LIKE ?3")
void updateId(String replaceThis, String replaceWith, String like);
I get always "You have attempted to set a parameter at position 1 which does not exist in this query string UPDATE configuration SET id = replace(id, ?1, ?2) WHERE id LIKE ?3
" error message which I don't understand because parameter at position 1 clearly exists where I put it. What am I missing?
Upvotes: 0
Views: 342
Reputation: 1292
you can try this query:
@Query("UPDATE configuration SET id = function('replace',id, ?1, ?2) WHERE id LIKE ?3")?
Upvotes: 2