title: What is wrong with this sql query to cause this error?
body: <p>What is wrong with this query?</p>
  
  <pre><code>" where mh.parent_id = ? "+ (roleIds != null ? " or mh.role_id in (" + roleIds + ")" : "") +
  </code></pre>
  
  <p>Error Message: </p>
  
  <blockquote>
    <p>PreparedStatementCallback; bad SQL grammar [select u.id,u.user_id,count(distinct pf.id),IfNULL(upm.grievance_autoassign_enable,true)  from users u  inner join user_roles ur on ur.user_id=u.id  left outer join user_preference_management upm on u.id = upm.id  inner  join management_hierarchy mh on mh.child_id = u.id or mh.role_id =ur.role_id  left outer join ( jbpm4_task  jt  inner join process_flow pf on pf.pid = jt.execution_id_ and pf.grievance_mgmt_id is not null)  on jt.assignee_ = u.user_id  where mh.parent_id = ?  or mh.role_id in ({role_id=2},{role_id=4},{role_id=1},{role_id=8},{role_id=38},{role_id=22},{role_id=69}) group by u.id,u.user_id  order by count(pf.id) ]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=2},{role_id=4},{role_id=1},{role_id=8},{role_id=38},{role_id=22},{role_id=69}) ' at line 1</p>
  </blockquote>