HHH-18750 : @OneToMany with @Any mapped in secondary table KO (ClassCastException)

He mistakenly assumes, at first glance, that the mappedBy attribut is not a @ManyToOne or @Any because the mappedBy attribut is mapped in a secondary table and therefore has a join.

The problem appears later during a cast where the instance of type DiscriminatedAssociationAttributeMapping is cast to PluralAttributeMapping.

https://hibernate.atlassian.net/browse/HHH-18750
This commit is contained in:
Vincent Bouthinon 2024-10-22 10:33:18 +02:00 committed by Christian Beikov
parent 4556995616
commit 82a76ac9aa

View File

@ -38,13 +38,13 @@
*/ */
@Jpa( @Jpa(
annotatedClasses = { annotatedClasses = {
ManyToOneWithAnyAndSameEntityTest.Actor.class, ManyToOneWithAnyAndSecondaryTable.Actor.class,
ManyToOneWithAnyAndSameEntityTest.Contact.class ManyToOneWithAnyAndSecondaryTable.Contact.class
}, },
integrationSettings = @Setting(name = JdbcSettings.SHOW_SQL, value = "true") integrationSettings = @Setting(name = JdbcSettings.SHOW_SQL, value = "true")
) )
@JiraKey("HHH-18750") @JiraKey("HHH-18750")
class ManyToOneWithAnyAndSameEntityTest { class ManyToOneWithAnyAndSecondaryTable {
@Test @Test
void testMappingManyToOneMappedByAnyPersistedInSecondaryTable(EntityManagerFactoryScope scope) { void testMappingManyToOneMappedByAnyPersistedInSecondaryTable(EntityManagerFactoryScope scope) {