We have recently discovered that some users are under the misapprehension that they can use the @Table annotation of a @MappedSuperclass to define unique key constraints applying to the table mapped by each inheriting entity. This is not intended. It doesn't make sense to assign a table to a @MappedSuperclass, and so it doesn't make sense to define a constraint on its columns. An inheriting @Entity may not even have the same columns, as a result of the action of an @AttributeOverride.
We should state explicitly that the @Table annotation simply may not occur on a @MappedSuperclass or @Embeddable.
We have recently discovered that some users are under the misapprehension that they can use the
@Table
annotation of a@MappedSuperclass
to define unique key constraints applying to the table mapped by each inheriting entity. This is not intended. It doesn't make sense to assign a table to a@MappedSuperclass
, and so it doesn't make sense to define a constraint on its columns. An inheriting@Entity
may not even have the same columns, as a result of the action of an@AttributeOverride
.We should state explicitly that the
@Table
annotation simply may not occur on a@MappedSuperclass
or@Embeddable
.