@Query(value = "select student_rid as row_id, student_name as Name from student_data where student_rid=:Student and visibility=true)", nativeQuery = true)
public List<Map<String, String>> findNameAndRowID(@Param("Student") Long Student);
I want to cache the list output, but when I am trying to cache the output the whole List is cached as a single cache entry, and because of this, I have to evict this whole cache(list) entry all the time when I either insert/delete even a single record into the database, which is not what I want as it does not serves the purpose of caching. So is there a way we can cache the list elements as a single entries such that I can only evict/update the single record at any insert/delete statement.
I am using Spring Boot, Java 8, and Spring tool suite as IDE.
This question has been asked multiple times.
The answer is generally the same.
I suspect any 1 of the links will help, but perhaps start with #3.