Hibernate的Session是怎么判断一个对象是新建还是一个dirty,其原理是怎样的
3条回答 默认 最新
mycell_13651784029 2009-10-10 12:27关注When session.load(obj), a copy of the loaded object (a snapshot) is made (see SessionImpl.initializeEntity() ), when session.flush(), all objects in session are compared to their saved snapshots to see if their property values have changed (dirty), if yes then that object's dirty properties will be updated in SQL (see SessionImpl.flushEntity()).
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报