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.
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. |