java.lang.ClassCastException: org.hibernate.impl.QueryImpl cannot be cast to java.util.List

java.lang.ClassCastException: org.hibernate.impl.QueryImpl cannot be cast to java.util.List



List list = (List)hibernateTemplate.getSessionFactory().getCurrentSession().createQuery(hql)
				.setInteger("mid", 1)

后面少了一个list();
    List list = (List)hibernateTemplate.getSessionFactory().getCurrentSession().createQuery(hql)
                .setInteger("mid", 1).list();


错误:应该是类型转换错误




你可能感兴趣的:(list)