java在HQL中尝试使用用例时出错
我试图在HQL查询中使用CASE-WHEN-THEN,但出现以下错误:
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: case near line 1,
column 387
案例的查询部分:
" and case hp.Type when 8 then ( " + str1 + ") else " +
" ( " + str2 + " ) end " );
这在where子句中。 基本上,我想在查询中获得str1字符串。类型是8,否则在我的查询中获取str2字符串
共 (0) 个答案