code: public static String getName(Path<?> path) {
          Path<?> parent = path.getMetadata().getParent();
          if (parent instanceof EntityPath) {
              Object columnMetadata = ((EntityPath<?>) parent).getMetadata(path);
              if (columnMetadata instanceof ColumnMetadata) {
                  return ((ColumnMetadata) columnMetadata).getName();
              }
          }
          return path.getMetadata().getName();
      }
docs: Extract the column name for the given path, returns the path name, if no ColumnMetadata is attached
  
  @param path patch
  @return column name or path name