不用改.HIBERNATE支持原始SQL的.

解决方案 »

  1.   

    select u.fname,u.email,s.time,s.kind,s.request,s.date from Shopbooks as s,
    Users as u where s.uid = u.uid and s.shid=20
    ....
    return 集合
    上面的名字必须和Hibernate中的FormBean对应
    List list = new .....得到这个集合
    Iterator it = list .iterator();--使用迭代器遍历集合
    while(it.hasNext()){
      Object[] o = (Object[])it.next();***使用Object数组
      o[0]u.fname,o[1]u.email,o[2]s.time........投影查询
    }