JAVA-006 / Intermediate
JPA @Query(nativeQuery=true) string concatenation
Why is this a problem?
Concatenating parameters while constructing native queries leads to injection.
How to fix it
java
@Query(value = "SELECT * FROM users WHERE name = :name", nativeQuery = true)
List<User> findNative(@Param("name") String name);