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());
    }
Returns this path's column metadata if present. Otherwise returns default
metadata where the column name is equal to the path's name.
querydsl-sql/src/main/java/com/querydsl/sql/ColumnMetadata.java