private DetachedCriteria makeCriteria(Map<String, Object> condition) {
        DetachedCriteria criteria = DetachedCriteria.forClass(Specialty.class);

        if (condition == null) {
            return criteria;
        }

        if (condition.containsKey("college_id")) {
            criteria.createAlias("college", "c").add(Restrictions.eq("c.id", condition.get("college_id")));
        }

        if (condition.containsKey("specialty_name")) {
            criteria.add(Restrictions.ilike("specialtyName", condition.get("specialty_name").toString(), MatchMode.ANYWHERE));
        }

        return criteria;
    }