{code:java}@Entity @Table(name = "table_per_class_base") @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class TablePerClassBase { TablePerClassEmbeddable embeddable; } @ Embeddable Id public class TablePerClassEmbeddable { Integer id; @OneToMany @JoinColumn(name = "embeddableParent") Set<TablePerClassBase> children; } @Entity @Table(name = "table_per_class_sub_1") public class TablePerClassSub1 extends TablePerClassBase {} @Entity @Table(name = "table_per_class_sub_2") public class TablePerClassSub2 extends TablePerClassBase {}{code}
Roughly this This model fails to persist elements. An assertion in {{OneToManyPersister#buildTableUpdate}} The problem seems to be too strict or maybe even wrong that we currently don’t handle abstract/denormalized tables in the collection persister .
{{assert tableReference.getTableName().equals( elementType.getIdentifierMapping().getContainingTableExpression() )}}
I think it should rather be {{assert elementType.containsTableReference(tableReference.getTableName())}} |
|