@CacheResult(cacheName = "testCache)
public Employee geteEmployee(@CacheKey String empId) {
//logic
return employee;
}
If employee is null, that null value should not be cached.
@CacheResult(cacheName = "testCache)
public Employee geteEmployee(@CacheKey String empId) {
//logic
return employee;
}
If employee is null, that null value should not be cached.
You can set the cacheNull property to false
.
cacheNull
public abstract boolean cacheNull
If set to false null return values will not be cached. If true (the default) null return values will be cached.
Defaults to true.
Default: true
@CacheResult(cacheName = "testCache", cacheNull = false)