axelor / axelor-open-platform

Open source Java framework for business application development
http://axelor.com
Other
391 stars 298 forks source link

DDL supports field comment,Since hibernate 5.6, @Comment annotation is supported #117

Open cabbage89 opened 1 year ago

cabbage89 commented 1 year ago

DDL supports field annotations, @Comment (org.hibernate.annotations.Comment) https://github.com/hibernate/hibernate-orm/pull/3611

https://github.com/axelor/axelor-open-platform/blob/master/axelor-tools/src/main/java/com/axelor/tools/code/entity/model/Property.java#L941

List<JavaAnnotation> all = new ArrayList<>();
.....
JavaAnnotation comment = new JavaAnnotation("org.hibernate.annotations.Comment");
    JavaCode commentValue = value.apply("{0:s}", title);
    if (commentValue != null) {
      comment.param("value", commentValue);
      all.add(comment);
    }

    all.add(widget);
    return all;