To avoid sql injections, normally Positional parameters and named parameters can be used in HQL as it demos here and stackoverflow also has samples. I want to know which steps can be taken when Criteria
is used.Any help with sample codes or useful links please.
Edit
Also when we save a object then ? let's say,the object may have a String variable and some one can assign a vulnerable sql query to it.
myObject.setName(somevulnerablesql); session.save(myObject);
In that case, should we have to check user input seperately before assigning to the object? or any other steps to avoid such sql injections ?