code: private static void addOrderPossiblyNested(Criteria c, PersistentEntity entity, String sort, String order, boolean ignoreCase) {
          int firstDotPos = sort.indexOf(".");
          if (firstDotPos == -1) {
              addOrder(c, sort, order, ignoreCase);
          } else { // nested property
              String sortHead = sort.substring(0, firstDotPos);
              String sortTail = sort.substring(firstDotPos + 1);
              PersistentProperty property = entity.getPropertyByName(sortHead);
              if (property instanceof Embedded) {
                  // embedded objects cannot reference entities (at time of writing), so no more recursion needed
                  addOrder(c, sort, order, ignoreCase);
              } else if (property instanceof Association) {
                  Association a = (Association) property;
                  Criteria subCriteria = c.createCriteria(sortHead);
                  PersistentEntity associatedEntity = a.getAssociatedEntity();
                  Class<?> propertyTargetClass = associatedEntity.getJavaClass();
                  cacheCriteriaByMapping(propertyTargetClass, subCriteria);
                  addOrderPossiblyNested(subCriteria, associatedEntity, sortTail, order, ignoreCase); // Recurse on nested sort
              }
          }
      }
docs: Add order to criteria, creating necessary subCriteria if nested sort property (ie. sort:'nested.property').