Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hibernate 4.0.1.Final case表达式不工作_Hibernate_Hql - Fatal编程技术网

Hibernate 4.0.1.Final case表达式不工作

Hibernate 4.0.1.Final case表达式不工作,hibernate,hql,Hibernate,Hql,我有以下HQL查询: SELECT CASE his.modelMailId WHEN 0 THEN 'abcd' ELSE his.modelMailLibelle END FROM CommunicationHistorique his 执行时,我有一个例外: org.hibernate.QueryException: undefined alias: CASE 有什么想法吗,我正在使用hibernate 4.0.1.Final???正如您在中所看到的,这个案例工作得很好。也许这是4.0

我有以下HQL查询:

SELECT CASE his.modelMailId WHEN 0 THEN 'abcd' ELSE his.modelMailLibelle END FROM CommunicationHistorique his
执行时,我有一个例外:

org.hibernate.QueryException: undefined alias: CASE
有什么想法吗,我正在使用hibernate 4.0.1.Final???

正如您在中所看到的,这个案例工作得很好。也许这是4.0.1中的一个问题,所以您可以尝试更新,看看它是否有效

你在使用什么数据库