code: private static String generateAliasRoot(String description) {
      String result = truncate(unqualifyEntityName(description), ALIAS_TRUNCATE_LENGTH)
          // Important to use Locale.ENGLISH.  See HHH-8579.  #toLowerCase() uses the default Locale.  Certain DBs
          // do not like non-ascii characters in aliases, etc., so ensure consistency/portability here.
          .toLowerCase(Locale.ENGLISH)
          .replace('/', '_') // entityNames may now include slashes for the representations
          .replace('$', '_'); //classname may be an inner class
      result = cleanAlias(result);
      if (Character.isDigit(result.charAt(result.length() - 1))) {
        return result + "x"; //ick!
      } else {
        return result;
      }
    }
docs: Generates a root alias by truncating the "root name" defined by
  the incoming decription and removing/modifying any non-valid
  alias characters.
  
  @param description The root name from which to generate a root alias.
  @return The generated root alias.