I have a code as following :
final String query = "SELECT id FROM " + getSimpleName() + " WHERE " + relationName + ".id = :successor";
final Query queryConcerned = this.entityManager.createQuery(query);
query.setParameter("successor", successorId);
But Sonar gives the following warning :
Use a variable binding mechanism to construct this query instead of concatenation.
As you can see the values I'm concatenating are not parameters, in doing so, am I vulnerable to SQL injections, if so, how can I solve this ?