При выполнении native query нужно в один из параметров вставить список id типа int.
Вот как устанавливаю параметр:
query.setParameter("numbers", numbers);
numbers - List<Integer>
Возникает ошибка:
Сaused by: org.eclipse.persistence.exceptions.DatabaseException:
Internal Exception: org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of [Ljava.lang.Object;. Use setObject() with an explicit Types value to specify the type to use.
Error Code: 0
Пока что пришлось выкручиваться вот так:
String ids = numbers.stream().map(Object::toString).collect(Collectors.joining(","));
sql = sql.replace("#numbers", "(" + ids + ")");