三种状态的区分关键在于: 有没有ID ID在数据中有没有 在内存中有没有(Session缓存) 三种状态: transient :内存中有对象,没有ID,缓存中也没有 persistent:内存中国有,缓存中有,数据库有(ID) detached:内存有,缓存没有,数据库有,ID 相关文章: