【问题标题】:Error in creating query in openbravo through hql通过 hql 在 openbravo 中创建查询时出错
【发布时间】:2014-03-04 08:05:41
【问题描述】:

这个问题可能有答案......但不适用于带有 postgresql 数据库的 openbravo。

我有 openbravo 3.0 框架。在我的窗口中,我有两个日期字段,即 fromdate 和 todate。要求是我必须编写一个 hql where 子句来根据当前日期过滤记录。日期字段是没有时区的时间戳。

表示从日期

todate > currentdate .

我浏览了这个link并将hql where子句写为

e.id in(select s.id from Tablename as s where s.fromdate current_date)

当我打开这个窗口时,我得到这个错误

创建查询时出现异常 select e from Tablename as e where ( e.id in(select s.Tablename_ID from Tablename as s where s.fromdate

但是,如果我将当前日期条件删除为

e.id in(select s.id from Tablename as s).. 它工作正常。

是因为 current_Date 函数吗? .我什至尝试了现在的功能..但我得到了同样的错误。

【问题讨论】:

    标签: hql postgresql-8.4 openbravo


    【解决方案1】:

    !!!出错了。 我写的查询有问题,在 where 子句中我选择了不正确的 id,因此当我给出以下查询时它运行正确。

    (Tablename.fromdate current_date) current_date函数没有问题。

    我想这可能会对某人有所帮助!!!

    提示:如果您想在openbravo中正确编写hql查询,请安装openbravo社区版免费提供的Hql查询工具模块。

    快乐编码

    【讨论】:

      猜你喜欢
      • 2014-11-04
      • 2018-12-14
      • 2015-01-20
      • 2011-11-04
      • 2023-04-05
      • 2021-03-15
      • 2012-02-19
      • 1970-01-01
      • 2014-11-11
      相关资源
      最近更新 更多