Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
要避免在重新附加对象时使用 UPDATE 语句,可以通过设置 select-before-update= “true”。如果设置了这个,hibernates 会尝试通过执行 SELECT 语句来确定是否需要 UPDATE。但是这种特性的优势是什么,毕竟我们是通过 SELECT 或 UPDATE 来访问 db。