code: public static boolean hasOrderBy(JPQLExpression jpqlExpression)
      {
          if (isSelectStatement(jpqlExpression))
          {
              return ((SelectStatement) jpqlExpression.getQueryStatement()).hasOrderByClause();
          }
          return false;
      }
docs: Checks for order by.
  
  @param jpqlExpression
  the jpql expression
  @return true, if successful