Joined Inheritence with Generated wrongly resolves columns for base entity
Description
If one has a base Entity Parent with the inheritance strategy @Inheritance(strategy = InheritanceType.JOINED) and a Child
public class Child extends Parent {}
@Generated(event = EventType.INSERT)
@Column(unique = true, insertable = false, updatable = false, columnDefinition = "INT(10)")
private Long someGenerated;
...
}
When now persisting a Child, hibernate 6.5.0+ will try to save the someGenerated column within the Parent table, which will fail, since that column is not part of the Parent entity.
If one has a base Entity
Parent
with the inheritance strategy@Inheritance(strategy = InheritanceType.JOINED)
and a Childpublic class Child extends Parent {} @Generated(event = EventType.INSERT) @Column(unique = true, insertable = false, updatable = false, columnDefinition = "INT(10)") private Long someGenerated; ... }
When now persisting a
Child
, hibernate 6.5.0+ will try to save thesomeGenerated
column within theParent
table, which will fail, since that column is not part of theParent
entity.