悠悠隐于市 2010-05-17 16:06
浏览 247
已采纳

HQL 查询语句问题? 朋友们帮忙看一下..

执行这天Hql语句时报如下错误:
org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: and near line 1, column 164:

HQL语句如下:

from BtripApplication btrip left join fetch btrip.applicationItemList btripItem
inner join btrip.organizationUnit orgUnit where

and ((btr.employee.ouCode like :code1 or btr.employee.ouCode like :code2)
and (btr.employee.ouCode like :orgUnitSearchPath or btr.employee.ouCode like :orgUnitSearchPath||'/%'))
and orgUnit.type is null or orgUnit.type =:orgGrounp
and :year is null or btripItem.from between to_date(:year||'-01-01','yyyy-MM-dd') and btripItem.toDate to_date(:year||'-12-31','yyyy-MM-dd');

.....
省略部分赋值的代码..

我看了一下,还真没找到哪里错误!。
谢谢.各位朋友的指点..

  • 写回答

3条回答

  • 拽拽的初行者 2010-05-17 16:12
    关注

    [quote]unexpected token[/quote]

    错误是,你的HSQL语句中,含有非法字符。

    核对下你的语句。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch