1

我想在jpql中按时间过滤,但我认为我做得不好。但是当我看到返回这个不是由horaEntrega过滤时。我正在使用eclipselink 2.5有什么想法吗??? 我尝试使用但不起作用,如果我尝试强制转换时间告诉我预期的NUMBER并得到DATE当我使用 sql im编写SELECT并且这工作正常 时,这很奇怪。当我写这篇文章时,我说预期的时间不是日期
SELECT e FROM Pedido e WHERE e.fechaEntrega = :fechaInicio AND e.horaEntrega < :horaEntregaque.setParameter("horaEntrega", horaEntrega, TemporalType.TIME);
SELECT e FROM Pedido e WHERE e.fechaEntrega = :fechaInicio AND CAST(e.horaEntrega AS TIMESTAMP) < :horaEntregacast(cast(etretst as timestamp) as time) < '08:00:00'

4

1 回答 1

1

我解决了 SELECT SELECT e FROM Pedido e WHERE e.fechaPedido = :fechaInicio AND CAST(CAST(e.horaPedido AS TIMESTAMP) AS TIME) < :horaZona和参数是que.setParameter("horaZona", new Time(horaPedido.getTime()).toString());

于 2013-07-23T10:32:36.363 回答