code: public static ColumnMetadata getColumnMetadata(Path<?> path) {
          Path<?> parent = path.getMetadata().getParent();
          if (parent instanceof EntityPath) {
              Object columnMetadata = ((EntityPath<?>) parent).getMetadata(path);
              if (columnMetadata instanceof ColumnMetadata) {
                  return (ColumnMetadata) columnMetadata;
              }
          }
          return ColumnMetadata.named(path.getMetadata().getName());
      }
docs: Returns this path's column metadata if present. Otherwise returns default
  metadata where the column name is equal to the path's name.