Allow null values to be cached with @CacheResult

Even though the JSR-107 spec forbids to store null values, our cache
abstraction allows that behaviour with a special handled (and this is
the default behaviour).

While this was working fine with our own set of annotations, the
JSR-107 interceptor counterpart was interpreting the spec sensu strictu.

We now allow for that special case as well.

Issue: SPR-13641
This commit is contained in:
Stephane Nicoll
2015-11-09 13:03:40 +01:00
parent 59b6600763
commit 2a2a8d3f93
13 changed files with 86 additions and 10 deletions

View File

@@ -10,6 +10,7 @@
<cache:advice id="cacheAdviceInterface" cache-manager="cacheManager">
<cache:caching cache="testCache">
<cache:cacheable method="cache"/>
<cache:cacheable method="cacheNull"/>
<cache:cacheable method="conditional" condition="#classField == 3"/>
<cache:cacheable method="unless" unless="#result > 10"/>
<cache:cacheable method="key" key="#p0"/>