jakartaee / persistence

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

duplicate persistent field names in hierarchy #599

Open gavinking opened 3 months ago

gavinking commented 3 months ago

I just noticed that JPA does not say what happens in the following circumstance:

@Entity class Super { @Id long id; String name; }
@Entity class Sub extends Super { String name; }

Nor in this case:

@Entity class Super { @Id long id; @Column("super_name") String name; }
@Entity class Sub extends Super { @Column("sub_name") String name; }

I would say that these are disallowed, or at least "not required/portable" and strongly discouraged. But we don't actually say that.