日期:2014-05-18 浏览次数:20695 次
DetachedCriteria userCriteria = DetachedCriteria.forClass(User.class, "u");
DetachedCriteria roleCriteria = userCriteria.createAlias("user_role", "r");
userCriteria.add(Restrictions.eq("u.name", "abc"));
userCriteria.add(Restrictions.eq("u.deptid", "124"));
roleCriteria.add(Restrictions.eq("r.roleid", new Long(1)));