Hibernate 休眠持续状态
我在hibernate文档中读到了关于这种状态的令人困惑的句子。有人能解释一下它是怎么工作的吗Hibernate 休眠持续状态,hibernate,jpa,persistent,Hibernate,Jpa,Persistent,我在hibernate文档中读到了关于这种状态的令人困惑的句子。有人能解释一下它是怎么工作的吗 Hibernate will detect any changes made to an object in persistent state and synchronize the state with the database when the unit of work completes. 假设我使用的是JPA,当我从数据库加载一个对象并对其进行更新,但不保存实体时,一段时间后应该仍然会更新。
Hibernate will detect any changes made to an object in persistent state and synchronize the state with the database when the unit of work completes.
假设我使用的是JPA,当我从数据库加载一个对象并对其进行更新,但不保存实体时,一段时间后应该仍然会更新。我是对的 否。它应该在工作单元完成时更新,即在事务结束时。因此,我不需要手动调用update方法,对吗?;>是的,因为Hibernate将检测对处于持久状态的对象所做的任何更改,并将状态与数据库同步。