code: public static QueryByCriteria newQuery(Class classToSearchFrom, Criteria criteria, boolean distinct)
      {
          criteria = addCriteriaForOjbConcreteClasses(getRepository().getDescriptorFor(classToSearchFrom), criteria);
          return new QueryByCriteria(classToSearchFrom, criteria, distinct);
      }
docs: Method declaration
  @param classToSearchFrom
  @param criteria
  @param distinct
  @return QueryByCriteria