How does Hibernate detect dirty state of an entity object?

后端 未结 5 2020
一整个雨季
一整个雨季 2020-12-02 05:50

Is it using some kind of byte codes modification to the original classes?

Or, maybe Hibernate get the dirty state by compare the given object with previously persiste

5条回答
  •  情歌与酒
    2020-12-02 06:46

    Hibernate default dirty checking mechanism will match all mapped properties of all currently attached entities against their initial loading-time values.

    You can better visualize this process in the following diagram:

    Default automatic dirty checking

提交回复
热议问题