The postgresql documentation states: in
predicate can not hold empty list
expression IN (value [, ...])
and as hibernate passes the native queries as is, it's predictable that this leads to a problem.
But as workaround you can follow this suggestion: initialize the list with an impossible value.
EDIT
Actually, this behaviour was changed in hibernate 5.4.10. See the commit:
SHA-1: ab9ae431858dc6727023d7f03bd6925f99011c62
* HHH-8901 replace "in ()" SQL with "in (null)" in QueryParameterBindingsImpl
And for your case the following sql will be generated:
select * from history h where h.project_id in (null)
It looks strange that the task HHH-8901 description completely irrelevant to these changes.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…