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
1 changed files with 3 additions and 3 deletions

View File

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