Closed galid1 closed 1 year ago
Hi @galid1
@CollectionCacheable
supports the key
parameter as the [@Cacheable
annotation does](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/cache/annotation/Cacheable.html#key()), as this library simply delegates obtaining the cache key to the Spring framework, see here.
I'm closing this issue, as I don't fully see what else you'd need to be delevoped. Please come up with a "minimally working example" (or broken example) demonstrating your use case (feel free to comment this issue still, I'll re-open if necessary). Then I can see how I can help you.
@CollectionCacheable(cacheNames = [CACHE_KEY_GET_BUSINESS_USER_BY_ID], putNull = false, key = "#ids")
fun listByIds(ids: List<Long>, option: BusinessUserFilterOption?): List<CacheWrapper<BusinessUserDto>> {
return businessUserRepository.findAllById(ids)
.filterByOption(option)
.map {
CacheWrapper(
cacheKey = it.id!!,
cacheTarget = BusinessUserDto.fromEntity(it)
)
}
}
Here is the case.
Then, it throws an error with following msg "Did not find exactly one Collection-like argument".
I already know, it can be done done by using repository cache. But, I think it is not good. Because it makes entity have to know third party lib.
Hi there, I wonder why, there is no way that I make method that, has two or more parameter.
I think that it can be easily done by making field annotation.
So can u develop it? If not, I want to know that reason.