谁能指出我如何将order by子句作为命名参数传递给HQL?
有效的示例:
select tb from TransportBooking as tb and TIMESTAMP(tb.bookingDate, tb.bookingTime) >= current_timestamp() order by tb.bookingDate
无效的示例:
select tb from TransportBooking as tb and TIMESTAMP(tb.bookingDate, tb.bookingTime) >= current_timestamp() order by :order
不支持,只能在WHEREand HAVING子句中使用输入参数,并且不能为ORDER BY子句使用参数。或者,如果我改写,您不能对列使用参数,只能对值使用。因此,要么:
WHERE
HAVING
ORDER BY