sbli27 2009-10-08 22:35
浏览 308
已采纳

Hibernate的Session脏检查问题

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()).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?