Allow @CachePut 'key' SpEL to refer to #result
Allow the @CachePut 'key' SpEL to refer to the result of the method call via a '#result' variable. This change is particularly useful when working with JPA entities that have generated @Id values since the ID will often not be available until the entity has been saved. Issue: SPR-10664
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
<cache:cache-evict method="multiConditionalCacheAndEvict" cache="secondary"/>
|
||||
<cache:cache-put method="multiUpdate" cache="primary"/>
|
||||
<cache:cache-put method="multiUpdate" cache="secondary"/>
|
||||
<cache:cache-put method="putRefersToResult" cache="primary" key="#result.id"/>
|
||||
</cache:caching>
|
||||
</cache:advice>
|
||||
|
||||
@@ -82,6 +83,7 @@
|
||||
<cache:cache-evict method="multiConditionalCacheAndEvict" cache="secondary"/>
|
||||
<cache:cache-put method="multiUpdate" cache="primary"/>
|
||||
<cache:cache-put method="multiUpdate" cache="secondary"/>
|
||||
<cache:cache-put method="putRefersToResult" cache="primary" key="#result.id"/>
|
||||
</cache:caching>
|
||||
</cache:advice>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user