日期:2014-05-20 浏览次数:20752 次
DetachedCriteria subquery = DetachedCriteria.forClass(Order.class, "o"); //创建一个子查询 subquery.add(Restrictions.between("createTime", DateUtils.addDays(createDate, 1), DateUtils.addDays(createDate, 2))).setProjection( Property.forName("o.cenacle.id")); //为子查询添加条件 return createCriteria(Subqueries.propertyNotIn("id", subquery)).list(); //在查询中加入子查询