title: Spring Scheduled Cache
body: <p>I have a method which returns list in my spring-boot project. This list is created with DTO mapping and i don't want my code execute sql query in every refresh of page. Sometimes new updates can come to the database. So for example I want it to refresh cache every 5 hours. Cacheable is running but not receiving new data. I looked at the Cache Evict examples, but my code doesn't make any cache when I apply it. And one more thing, is it possible to cache more than one list in same method? For example like in the code below but it does not work:</p>
  <pre><code>@Override
  @Cacheable(value = &quot;apps&quot;)
  @Scheduled(cron = &quot;0 0/30 * * * ?&quot;)
  @CacheEvict(value = &quot;apps&quot;,  allEntries=true)
  public List&lt;Apps&gt; executeLatestApplications(){
  ...
  List&lt;Apps&gt; apps = em.createNamedQuery(&quot;Apps&quot;, Apps.class).getResultList();
  ...
  }
  </code></pre>
  <p>This is where apps SQL Result Mapping:</p>
  <pre><code>@NamedNativeQuery(
          name = &quot;AppsQuery&quot;,
          query = &quot;SELECT id, name, address, repo, version FROM apps&quot;,
          resultSetMapping = &quot;Mapping&quot;
  )
  
  @SqlResultSetMapping(
          name = &quot;Mapping&quot;,
          classes = @ConstructorResult(targetClass= com.meursault.apps.model.Apps.class,
                  columns = {
                          @ColumnResult(name = &quot;id&quot;, type = Long.class),
                          @ColumnResult(name = &quot;name&quot;, type = String.class),
                          @ColumnResult(name = &quot;address&quot;, type = String.class),
                          @ColumnResult(name = &quot;repo&quot;, type = String.class),
                          @ColumnResult(name = &quot;version&quot;, type = String.class))
  </code></pre>