I am currently in the process of developing a Filter function that is responsible for sorting a list. Utilizing ajax, I aim to retrieve and exhibit the outcomes.
https://i.sstatic.net/Zf62m.png
However, my struggle lies in finding a solution to return results when both the search input and an option have been designated.
Every time I attempt to formulate my query as follows:
@Query(value = "SELECT * FROM colaboradores where name LIKE :search% AND department = ? AND category = ? ORDER BY id DESC", nativeQuery = true)
List <Colaboradores> filterColaboradorBySearch(@Param("search")String search, int department, int category);
ERROR:
Caused by: org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List com.dexa.hr.repository.ColaboradorRepository.filterColaboradoresAll(java.lang.String,int,int)! Reason: Mixing of ? parameters and other forms like ?1 is not supported!; nested exception is java.lang.IllegalArgumentException: Mixing of ? parameters and other forms like ?1 is not supported!
...
Seeking clarification on why this occurs.