![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hibernate
fengfan2008vip
这个作者很懒,什么都没留下…
展开
-
延迟加载fetch, lazy与更新cascade, inverse
fetch 和 lazy 主要是用来级联查询的,而 cascade 和 inverse 主要是用来级联插入和修改的 fetch参数指定了关联对象抓取的方式是select查询还是join查询,select方式时先查询返回要查询的主体对象(列表),再根据关联外键 id,每一个对象发一个select查询,获取关联的对象,形成n+1次查 询;而join方式,主体对象和关联对象用一句外键原创 2008-12-10 11:13:00 · 466 阅读 · 0 评论 -
the Common Problems of Hibernate
1. 如何保存双向关联When you update a bidirectional association you must update both ends. parent.getChildren().add(child); child.setParent(parent);2. persisit和save的区别Both methods make a transient原创 2009-04-13 09:55:00 · 367 阅读 · 0 评论