我真的想知道更多有关更新,导出和可以提供给hibernate.hbm2ddl.auto
我需要知道何时使用更新的值的更多信息,何时不知道?还有什么选择?
这些是可能发生在DB上的变化:
在每种情况下,最佳解决方案是什么?
我开始在我的APP中使用这2个休眠注释.
@DynamicUpdate(value=true)
@SelectBeforeUpdate(value=true)
Run Code Online (Sandbox Code Playgroud)
首先,我将尝试解释我对它的理解,以了解我是否正确.
@DynamicUpdate(value=true)
Run Code Online (Sandbox Code Playgroud)
仅更新modified values实体中的内容Hibernate needs to track those changes
@SelectBeforeUpdate(value=true)
Run Code Online (Sandbox Code Playgroud)
创建一个select之前update知道哪些属性已被更改,这在实体已在不同会话上加载和更新时很有用Hibernate is out of tracking entity changes
这2个肯定是否正确?
我主要担心的是.
在DB performance哪个更好或更快地更新所有的实体领域的一次或generate a select to know which columns update and update only the modified columns?