麻烦大神帮我看一下下面的代码报错,应该怎修改?
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigInteger
@Override
public int getUserCount(int surveyId) {
String sql = "select count(*) from (SELECT distinct(sh.userId) FROM
survey_history as sh where sh.userId = ?) as r";
SQLQuery query = sessionFactory.getCurrentSession().createSQLQuery(sql);
query.setParameter(0, surveyId);
BigInteger count = (BigInteger)query.uniqueResult();
return count.intValue();
}