@CacheEvict used to support an array of cache-names as value which is no longer possible
If an invocation of a method results in multiple caches to be cleared, the following was possible using v1.1.8 of this plugin.
@CacheEvict(value=[StatisticsService.SERVICE_STATISTICS_CACHE, StatisticsService.DETAILED_TRANSFER_STATISTICS_CACHE, StatisticsService.GENERAL_STATISTICS_CACHE], allEntries=true)
Now it's throwing an exception as the cacheNameException is being cast to an ConstantExpression (ConstantExpression cacheNameExpression = (ConstantExpression)ScriptBytecodeAdapter.castToType(annotationNode.getMember("value"), ConstantExpression.class);)
Were you able to solve this? I am stuck with this very same problem:
@CacheEvict(value = ['ok'], allEntries = true)
def okce() {
println 'evict called'
}
I'm getting the following error after changing from value = 'ok' to value = ['ok'] General error during semantic analysis: Cannot cast object 'org.codehaus.groovy.ast.expr.ListExpression@7791d570[org.codehaus.groovy.ast.expr.ConstantExpression@29585d0d[ok]]' wi th class 'org.codehaus.groovy.ast.expr.ListExpression' to class 'org.codehaus.groovy.ast.expr.ConstantExpression'
Blast from the past :) Sorry, but I can't remember if and how I solved it... Most likey moved to inject the underlying CacheManager and doing the evict myself?