0
서비스 호출을 캐시하는 데 사용할 수있는 Spring Cache을 참조하십시오.두 속성을 키로 사용하여 스프링 캐시를 사용하는 방법
는 특히 다음 XML 스 니펫 : 키가 하나의 속성 인 경우
<!-- the service we want to make cacheable -->
<bean id="bookService" class="x.y.service.DefaultBookService"/>
<!-- cache definitions -->
<cache:advice id="cacheAdvice" cache-manager="cacheManager">
<cache:caching cache="books">
<cache:cacheable method="findBook" key="#isbn"/>
<cache:cache-evict method="loadBooks" all-entries="true"/>
</cache:caching>
</cache:advice>
<!-- apply the cacheable behavior to all BookService interfaces -->
<aop:config>
<aop:advisor advice-ref="cacheAdvice" pointcut="execution(* x.y.BookService.*(..))"/>
</aop:config>
위의 메커니즘이 작동합니다. isbn과 작성자를 기반으로 캐시해야합니다.
누군가 두 가지 속성을 사용하여 캐싱을 사용 설정하는 방법을 제안 할 수 있습니까?
감사
감사합니다. 저건 완벽 해. – kevin