persistence icon indicating copy to clipboard operation
persistence copied to clipboard

duplicate persistent field names in hierarchy

Open gavinking opened this issue 1 year ago • 0 comments
trafficstars

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.

gavinking avatar Mar 19 '24 09:03 gavinking