如何在hibernate中解析query.list()的java.lang.ClassCastException

时间:2017-12-18 18:00:01

标签: java hibernate

嗨,我真的很喜欢java编程。

但是我试图使用Hibernate执行select选项但是我得到了一个异常

这是我的代码。

public List<Ticket> getTableData(Ticket parameters, String username, int minCount, int start) throws HibernateException, SQLException, Exception {

        Session session = sessionFactory.getCurrentSession();

        Query query;

        query = session.createQuery("FROM Ticket T "
                + "INNER JOIN Systemuser SU ON SU.employee.employeeid = T.employee.employeeid "
                + "INNER JOIN Status S ON S.statusid = T.status.statusid "
                + "WHERE SU.username = :username AND S.isfinalstatus <> :isfinalstatus");
        query.setParameter("username", username);
        query.setParameter("isfinalstatus", MasterDataVarList.AFFINITI_CODE_ISFINALSTATUS);

        query.setMaxResults(minCount);
        query.setFirstResult(start);
        return query.list();
    } 

0 个答案:

没有答案