ehcache:Null key returned for cache operation错误
这个错误一般都是某个key为null值导致
@Caching(
cacheable = {
@Cacheable(value = “emp”,key = “#lastName”)
},
put = {
@CachePut(value = “emp”,key = “#result.id”),
@CachePut(value = "emp",key = "#result.email")
}
)
上面记录我的报错因为email在数据库中为空,所以发生错误,因此出现此错误考虑key的返回值是否为空即可