private int compareNames(final T table, final T arg) {
      int cmp = getDbName(table).compareTo(getDbName(arg));
      if (cmp == 0) {
        String argTableName = getTableName(arg);
        if (argTableName != null) {
          cmp = getTableName(table).compareTo(argTableName);
        }
      }
      return cmp;
    }
Compares a table to another by names.
@param table the table
@param arg the argument table
@return &lt; 0, 0, &gt; 0
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObjectUtils.java