A实体里有一对一映射B,B实体有一对一映射C查询A,怎么查询到c级,进而能使用“a.b.c的属性”?
A a = dao.fetchLinks(dao.fetch(A.class, id), null);这样只能查询到B级,a.b.c是null
A a = dao.fetchLinks(dao.fetch(A.class, id), null); dao.fetchLinks(a.getB(), null);
@wendal如果是:List a = dao.fetchLinks(dao.query(A.class, id), null);这样怎么查询到c级?
List list = dao.fetchLinks(dao.query(A.class, id), null); for (A a : list) { dao.fetchLinks(a.getB(), null); }