jpql中的TemporalTipe.Time参数



我想通过jpql中的Time进行筛选,但我认为我做得不好
SELECT e FROM Pedido e WHERE e.fechaEntrega = :fechaInicio AND e.horaEntrega < :horaEntregaque.setParameter("horaEntrega", horaEntrega, TemporalType.TIME);,但当我看到返回时,它不会被horaEntrega过滤。我正在使用eclipselink 2.5知道吗
我试过使用SELECT e FROM Pedido e WHERE e.fechaEntrega = :fechaInicio AND CAST(e.horaEntrega AS TIMESTAMP) < :horaEntrega,但不起作用,如果我试着选到时间,我会说我期望数字并得到日期当我使用cast(cast(etretst as timestamp) as time) < '08:00:00'在sql-im中编写SELECT时,这很奇怪,而且效果很好。当我写这篇文章时,告诉我预期的是TIME而不是DATE

我解析了SELECTSELECT 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());

最新更新