Have an issue to generate table level comment for a table produced by the @ElementCollection.
Hibernate version: 6.6.4.Final
Main entity:
@Entity
public class MetaInformation {
@Id
public String globalId;
@ElementCollection
@OrderColumn(name = "elementOrder", nullable = false)
@Comment("My init comment for profiles element collection")
public List<Profile> profiles;
}
Embaddable:
@Embeddable
public class Profile {
@Comment("URL to profile in the www")
public String url;
@Comment("DSTU version")
public String dstu;
public Profile() {
}
public Profile(String url, String dstu) {
this.url = url;
this.dstu = dstu;
}
}
Expected behavior is that comment My init comment for profiles element collection is created for the meta_information_profiles side table, but instead it is created for the main meta_information table. In case of replasing property level @Comment annotation to the class level @Comment(on = "profiles", value = "...") annotation it is just ignored.
Is it possible to get desired behavior?
Retested with other versions and mentioned behavior exists since 6.5.0.Final
In case of existence of the class level and the property level @Comment annotations, the one from class level just ignored:
@Entity
@Comment("Comment that will be ignored")
public class MetaInformation {
@Id
public String globalId;
@ElementCollection
@OrderColumn(name = "elementOrder", nullable = false)
@Comment("Comment that will be used as a class/table level instead for the MetaInformation ")
public List<Profile> profiles;
}
Sounds like a bug to me. Please try to create a reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.