@Query(value="select * from author a where a.last_name= ?1",nativeQuery = true)
What does ?1 mean in the above query?
This ?1
indicate a positional parameters is a different practice for define a query parameters to advoid some issue like SQL injection, for example:
String statment = "SELECT * from Users WHERE name=:nameParam and role=:roleParam";
//some code
query.setString("nameParam", nameValue);
query.setString("roleParam", roleValue);
String statment = "SELECT * from Users WHERE name=?1 and role=?2";
//some code
query.setString(1, nameValue);
query.setString(2, roleValue);