说明hql不支持isnul,你可以使用原始的sql语句来做

解决方案 »

  1.   

    可是hibernate的文档中明明就用了isnull函数啊?The next query uses the MS SQL Server isNull() function to return all the accounts and unpaid payments for the organization to which the current user belongs. It translates to an SQL query with three inner joins, an outer join and a subselect against the ACCOUNT, PAYMENT, PAYMENT_STATUS, ACCOUNT_TYPE, ORGANIZATION and ORG_USER tables. select account, payment
    from Account as account
        left outer join account.payments as payment
    where :currentUser in elements(account.holder.users)
        and PaymentStatus.UNPAID = isNull(payment.currentStatus.name, PaymentStatus.UNPAID)
    order by account.type.sortOrder, account.accountNumber, payment.dueDate
      

  2.   

    count(a) 不可能出现null的8!
      

  3.   

    up sgdb(神天月晓)
    照说明看来,可能是在select中不支持,但在where条件中支持。