I know I can pass a list to named query in JPA, but how about NamedNativeQuery? I have tried many ways but still can\'t just pass the list to a NamedNativeQuery. Anyone know
A list is not a valid parameter for a native SQL query, as it cannot be bound in JDBC. You need to have a parameter for each argument in the list.
where u.user_id in (?id1, ?id2)
This is supported through JPQL, but not SQL, so you could use JPQL instead of a native query.
Some JPA providers may support this, so you may want to log a bug with your provider.