@Cacheable(modelId = "cache")
public User detail(String id) {
return getSession().get(User.class, id);
}
报org.springmodules.cache.provider.ObjectCannotBeCachedException: The cache can only store implementations of java.io.Serializable
错误
如果改成:
@Cacheable(modelId = "cache")
public User detail(String id) {
return getSession().load(User.class, id);
}
就不报错 ,这是为什么呢