![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Hibernate
Yokubee
做自己!!为梦想奋斗!!
展开
-
HQL 中 fetch 作用
public class Parent{ private int id; private String name; private List children=new ArrayList(); //....setter && getter}public class Child{ private int id; private String name; //....setter && getter} fetch设置为lazy,查询Parent对象的时候,默原创 2010-08-09 16:08:00 · 1739 阅读 · 0 评论 -
Hibernate异常:query specified join fetching, but the owner of the fetched association was not present in the select list
org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list报这个异常是因为查询时返回的对象不包含有该join fetch后面的对象,因此可以将fetch删除就可以啦。这里的fetch就是将fetch后面的对象setter到查询返回的对象中。因此当不存在包含时,就会该报错!//这里Student和T原创 2010-08-23 17:08:00 · 9976 阅读 · 1 评论