William Rosenquist Burns (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a7b38f...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMjJmODA1ODZk...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16033?atlOrigin=eyJpIjoiMjJmOD...
) HHH-16033 (
https://hibernate.atlassian.net/browse/HHH-16033?atlOrigin=eyJpIjoiMjJmOD...
) Many-to-Many inverse mapping referencing the same class uses pk instead of fk field for
removal (
https://hibernate.atlassian.net/browse/HHH-16033?atlOrigin=eyJpIjoiMjJmOD...
)
Issue Type: Bug Affects Versions: 6.2.0.CR1 Assignee: Unassigned Components:
hibernate-core Created: 12/Jan/2023 08:17 AM Priority: Major Reporter: William Rosenquist
Burns (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a7b38f...
)
While updating Infinispan 2LC to use Hibernate 6.2.0 from 6.0.2 we found a regression with
how many to many mappings do a removal. It seems to be trying to use the primary key
identifier instead of the foreign key field. This is a problem for a test as the primary
key is a Long and the foreign key is a String.
This causes a ClassCastException when it tries to remove any many-to-many mappings that
may exist.
<bag name="bagOfItems" inverse="true"
table="items_otheritems">
<key column="other_item_id"/>
<many-to-many class="Item" property-ref="name"
column="item_name" />
</bag>
This mapping is the underlying cause.
The test just creates an entity in one session, then in a second loads it and removes it,
quite simple. PR will be attached after.
(
https://hibernate.atlassian.net/browse/HHH-16033#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16033#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#100214- sha1:b03f6a4 )