The expression `id in (null)` is equivalent to `id = null` which is always null (or more accurately Uknown) and where unknown will have the same result as where false.
Workarounds:
where id in (select null::int where false)
where id not in (select null::int where false)
or avoiding the cast:
where id in (select id from project_type_variants where false)
where id not in (select id from project_type_variants where false)
Even better in my opinion if Hibernate instead "where value in (null)" as a
workaround for several DB's not handling "where value in ()", use