DetachedCriteria级联查询

对于二级级联查询,参考文档中有说明,那么对于三级及以上该如何实现呢?下面以三级级联查询为例。

DetachedCriteria dc = DetachedCriteria.forClass(Student.class);    
dc.createAlias("team", "t");    
dc.createAlias("t.school", "s");    
dc.add(Restrictions.like("s.schoolName", schoolName, MatchMode.ANYWHERE)); 

你可能感兴趣的:(Criteria)