Passing List<Integer> in spring data jpa native query

Try taking away the @Query and make the method name:

public List<Event> findByTypeIn(List<Integer> types);

See table 2.2 in the link: http://docs.spring.io/spring-data/jpa/docs/1.2.0.RELEASE/reference/html/


I tried like below and it works for me.

@Query(value = "select * from events where type_id in :types", nativeQuery = true)
List<Event> findEventsByType(@Param("types") List<Integer> types);

@Query(value = "SELECT c from Company c where " +
    "c.companyName IN (:company_names)")
List<Company> findCompaniesByName(@Param("company_names") List<String> companyNames);

This is the solution to your problem.

Here I am passing List which contains company names and I am querying DB and storing result in List.

Hope this hepls!