不能!
query 并不知道会返回何种类型,只有调用者才知道。如果你讨厌那个警告,你可以加上
@SuppressWarnings("unchecked")
public   List <BlogCategory>   findBlogCategoriesByAccountId ...

解决方案 »

  1.   

    [size=11px]我倒了 有人能帮我想个办法??[/size]
      

  2.   

    如果你讨厌那个警告,你可以加上 
    @SuppressWarnings("unchecked") 
    public       List   <BlogCategory>       findBlogCategoriesByAccountId   ...
      

  3.   

    最好还是写成这样:
    public List findBlogCategoriesByAccountId 
    在设计较通用的方法时,最好不要具体指定哪个对象类型,这样有利于扩展...
      

  4.   

    既然方法为Public,建议就不要使用泛型啦。
    如果方法为Private,就可以使用泛型,只需要调用者知道存储的是何种类型的元素即可。
      

  5.   

    @SuppressWarnings("unchecked")  可以解除警告