code: public static <T> Root<T> findRoot(CriteriaQuery<T> query) {
          return findRoot(query, query.getResultType());
      }
docs: Find Root of result type
  
  @param query criteria query
  @return the root of result type or null if none