title: Detecting Injection in Hibernate
body: <p>I'm using Hibernate and I want to prevent injections into Hibernate prepared statements.
  Is there a straightforward way to do this?
  Regards,
  Hamed</p>
  
  <hr>
  
  <p>Let me rephrase my problem. :-) I have a lot of queries in my code which are in form: session.createQuery(...). There are two kinds of queries. those who have setParameters, and those who does not have. The latter is in form: select * from XYZ where username = '" + username + "' and password = '" + password + "'" which is not suitable for me. Now, my problem is how I can find second form automatically. Do I have any solution?</p>