IFNULL equivalent in Hibernate Query Language?

喜夏-厌秋 提交于 2019-12-03 05:43:56

COALESCE is the official equivalent.

It returns the first non-null of its arguments.

Example:

    COALESCE(id_pati, 0)

Link Wikipedia

Nhibernate docs are out of date. Check http://docs.jboss.org/hibernate/stable/core/reference/en/html/queryhql.html

If nothing works you can try:

select 
   case 
     when something is not NULL then 0
     else 
   end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!