就在return这一句老是提出:Type safety: The expression of type List needs unchecked conversion to conform to List<Guestbook>警告。

解决方案 »

  1.   

    public List getGuestbooks(){
    List list=this.getHibernateTemplate().find("from Guestbook order id desc");
                    return list;
    }
      

  2.   

    改成象楼上所说的那样的话,又会出现象下面这样的警告,该怎么消除呀!有没有根本的解决方法。List is a raw type. References to generic type List<E> should be parameterized
      

  3.   


    @SuppressWarnings("unchecked")
    public List<Guestbook> getGuestbooks() {
        return (List<Guestbook>)this.getHibernateTemplate().find("from Guestbook order id desc");
    }