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 · 1826 阅读 · 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 · 10132 阅读 · 1 评论
分享