this is the DAO method i have to retrieve the list of students from DB and on RunTime it says -
org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
which is driving me crazy. Can anyone please tell me what i might have missed?
public List<Student> getStudentsByIds(List<Integer> studentIds) {
Session session = SessionFactoryUtils.getSession(getSessionFactory(), true);
SQLQuery query = session.createSQLQuery("SELECT * FROM students s WHERE s.id IN (:studentIds)");
query.setParameterList("studentIds", studentIds);
return query.list();
}
id = ANY(:studentIds)since you are providing an array