veeeeeeeeee 2014-04-30 11:33
浏览 969
已采纳

java.lang.Integer cannot be cast to

public List<Materials> findAllMaterialsByAppid(Integer appid) {
    String hql1 = "select medid from Materials where appid = ? and pid = 0";
    List<Materials> list = this.hibernateTemplate.find(hql1, appid);
    if (list != null && list.size() > 0) {
        if(list.get(0).getMedid() != null){
            Integer medid = (Integer)list.get(0).getMedid();
            String hql2 = "from Materials where appid = ? and pid = ?";
            return this.hibernateTemplate.find(hql2, appid, medid);
        }

请教一下大家

  • 写回答

5条回答 默认 最新

  • ck504323276 2014-04-30 11:55
    关注

    String hql1 = "from Materials where appid = ? and pid = 0";

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?