jakartaee / persistence

https://jakartaee.github.io/persistence/
Other
191 stars 55 forks source link

Add value attribute to @Column annotation #385

Closed hantsy closed 1 year ago

hantsy commented 1 year ago

Currently using the @Column when specifying a name, we have to add name attribute explicitly.

We can add a value as alias of the name attribute.

BTW, in the @AttributeOverrides javadoc, there is an example like this.

@Embedded
@AttributeOverrides({
       @AttributeOverride(name="startDate", 
                          column=@Column("EMP_START")),
       @AttributeOverride(name="endDate", 
                          column=@Column("EMP_END"))
})
public EmploymentPeriod getEmploymentPeriod() { ... }

This is problematic, if we do not have the value attribute of @Column.

hantsy commented 1 year ago

I added a PR https://github.com/jakartaee/persistence/pull/386 to add the missing name in the above example codes.

hantsy commented 1 year ago

Is there a value attribute planned to be added in the new version?