org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
<p>this is the DAO method i have to retrieve the list of students from DB and on RunTime it says - </p>

<blockquote>
  <p>org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"</p>
</blockquote>

<p>which is driving me crazy. Can anyone please tell me what i might have missed?</p>

<pre><code>public List&lt;Student&gt; getStudentsByIds(List&lt;Integer&gt; 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();
}
</code></pre>