code: private void parseOrdering(String ordering) {
          final String comma = ",";
          final String space = " ";
  
          StringTokenizer tokenizer = new StringTokenizer(ordering, comma);
  
          sortOrders = new ArrayList<KunderaQuery.SortOrdering>();
          while (tokenizer.hasMoreTokens()) {
              String order = (String) tokenizer.nextElement();
              StringTokenizer token = new StringTokenizer(order, space);
              SortOrder orderType = SortOrder.ASC;
  
              String colName = (String) token.nextElement();
              while (token.hasMoreElements()) {
                  String nextOrder = (String) token.nextElement();
  
                  // more spaces given.
                  if (StringUtils.isNotBlank(nextOrder)) {
                      try {
                          orderType = SortOrder.valueOf(nextOrder.toUpperCase());
                      } catch (IllegalArgumentException e) {
                          logger.error("Error while parsing order by clause:");
                          throw new JPQLParseException("Invalid sort order provided:" + nextOrder);
                      }
                  }
              }
              sortOrders.add(new SortOrdering(colName, orderType));
          }
      }
docs: Parses the ordering @See Order By Clause.
  
  @param ordering
  the ordering