java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.AggregateNode非法的状态!~!你好好看看你什么地方用错了东西

解决方案 »

  1.   

    select loan.l_ID_number ,sum(loan.l_money) from loan,mainInfo where loan.l_ID_number=mainInfo.m_ID_number and mainInfo.m_addr like '1155______' group by loan.l_ID_number 
      

  2.   

    分组的字段一定要在select 列表里面,楼上的对了,如果还是不行,那就是hql不支持这种写法,那用 hibernate 的native sql就可以了,只要保证你这句sql语法没问题。
      

  3.   

    楼主起个别名select sum(l.l_money) from loan l,mainInfo m where l.l_ID_number=m.m_ID_number and m.m_addr like '1155______' group by l.l_ID_number
      

  4.   

    名字好另类,看了半天不能就此路过,同意ls
    起个别名,hql可以用sum函数.被你的下划线和l给搞晕了,呵呵.
      

  5.   

    select max(price) from PubSaleProductVO as product join product.pubsaleInfos as info where product.id=? 
    本来报跟lz一样的错,后来改成
    select max(info.price) from PubSaleProductVO as product join product.pubsaleInfos as info where product.id=? 
    就OK了