Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYjdmMTc3Mjk3...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16358?atlOrigin=eyJpIjoiYjdmMT...
) HHH-16358 (
https://hibernate.atlassian.net/browse/HHH-16358?atlOrigin=eyJpIjoiYjdmMT...
) TABLE_PER_CLASS one-to-many fails to persist (
https://hibernate.atlassian.net/browse/HHH-16358?atlOrigin=eyJpIjoiYjdmMT...
)
Issue Type: Bug Affects Versions: 6.2.0.CR4 Assignee: Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Components: hibernate-core Created: 22/Mar/2023 11:32 AM Fix Versions: 6.2.0 Priority:
Major Reporter: Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
@Entity
@Table(name = "table_per_class_base" )
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class TablePerClassBase {
TablePerClassEmbeddable embeddable;
}
@Embeddable
public class TablePerClassEmbeddable {
@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 {}
Roughly this model fails to persist elements. An assertion in
OneToManyPersister#buildTableUpdate seems to be too strict or maybe even wrong.
assert tableReference.getTableName().equals(
elementType.getIdentifierMapping().getContainingTableExpression() )
I think it should rather be assert
elementType.containsTableReference(tableReference.getTableName())
(
https://hibernate.atlassian.net/browse/HHH-16358#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16358#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100219- sha1:eb3f1fe )