code: public static <T, K> Join<T, K> findJoinedType(CriteriaQuery<T> query, Class<T> rootClass, Class<K> joinClass) {
          Root<T> root = findRoot(query, rootClass);
          return findJoinedType(root, rootClass, joinClass);
      }
docs: Find Joined Root of type clazz
  
  @param <T>
  @param query     the criteria query
  @param rootClass the root class
  @param joinClass the join class
  @return the Join