我java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
在执行时遇到异常int totalCount=criteria.list().size();
。请帮我找出原因和解决方案。
public GridPageDet list(DwrParam dwrParam,UserFound user,JobFound job) throws Exception {
Query query = getSession().createSQLQuery(
"select user_id from hs_cust_users where cust_id IN(select cust_id from customers where user_id=:userId)").setParameter("userId", user.getId());
Collection<Object[]> list = (Collection<Object[]>)query.list();
Criteria criteria=getSession().createCriteria(Filter.class);
criteria.createCriteria("filter.typeId", "filterType", Criteria.FULL_JOIN);
criteria.add(Expression.eq("status", 1));
if(user!=null && user.getId()!=null){
Object statusArr [] = {1};
criteria.createCriteria("user", "user", Criteria.FULL_JOIN);
criteria.add(Expression.in("status", statusArr));
if(user.getAccess().getId().intValue() == Helper.priv.intValue() ||
user.getAccess`enter code here`().getId().intValue() == Helper.id.intValue()){
criteria.add(Expression.in("user.id", list));
}else{
criteria.add(Expression.eq("user.id", user.getId()));
}
}
int totalCount=criteria.list().size();
}