-
瞬态(transient)
-
The instance is not associated with any persistence context. It has no persistent identity or primary key value.
持久化(persistent)
-
The instance is currently associated with a persistence context. It has a persistent identity (primary key value) and can have a corresponding row in the database. For a particular persistence context, Hibernate guarantees that persistent identity is equivalent to Java identity in relation to the in-memory location of the object.
脱管(detached)
-
The instance was once associated with a persistence context, but that context was closed, or the instance was serialized to another process. It has a persistent identity and can have a corresponding row in the database. For detached instances, Hibernate does not guarantee the relationship between persistent identity and Java identity.
HIbernate符合Java习惯的关系数据库持久化之实例状态
最新推荐文章于 2024-04-06 08:00:00 发布
本文详细解释了对象在三种不同持久化状态中的含义:瞬态、持久化和脱管。这些状态与Hibernate会话(即持久化上下文)密切相关,并探讨了每种状态下实例的特点及其与数据库的关系。
4922

被折叠的 条评论
为什么被折叠?



