code: public static String getSortableFieldFromClass( Class<?> clazz ) {
  
          /** See if the fieldName is in the field listStream already.
           * We keep a hash-map cache.
           * */
          String fieldName = getSortableField( clazz );
  
          /**
           * Not found in cache.
           */
          if ( fieldName == null ) {
  
              /* See if we have this sortable field and look for string first. */
              for ( String name : fieldSortNames ) {
                  if ( classHasStringField( clazz, name ) ) {
                      fieldName = name;
                      break;
                  }
              }
  
              /*
               Now see if we can find one of our predefined suffixes.
               */
              if ( fieldName == null ) {
                  for ( String name : fieldSortNamesSuffixes ) {
                      fieldName = getFirstStringFieldNameEndsWithFromClass( clazz, name );
                      if ( fieldName != null ) {
                          break;
                      }
                  }
              }
  
              /**
               * Ok. We still did not find it so give us the first comparable or
               * primitive that we can find.
               */
              if ( fieldName == null ) {
                  fieldName = getFirstComparableOrPrimitiveFromClass( clazz );
              }
  
              /* We could not find a sortable field. */
              if ( fieldName == null ) {
                  setSortableField( clazz, "NOT FOUND" );
                  Exceptions.die("Could not find a sortable field for type " + clazz);
  
              }
  
              /* We found a sortable field. */
              setSortableField( clazz, fieldName );
          }
          return fieldName;
  
      }
docs: Gets the first sortable field.
  
  @param clazz the class we are getting the sortable field from.
  @return sortable field