原因: sessionFactory.getCurrentSession().createQuery(sql);开启的是hibernate的面向对象语句所以不可以 解决反方式: 修改为 sessionFactory.getCurrentSession().createSQLQuery(sql)