IllegalArgumentException when using @Proxy and trying to delete a loaded but proxied class
Description
I'm receiving an IllegalArgumentException while trying to delete an entity that is a part of a @ContainedIn/@IndexedEmbedded relationship. I created a testcase to reproduce the error i'm seeing. The original issue that prompted this was actually a ClassCastException as discussed in this thread
I've spend some time on the issue. The problem is that we enlist the required Method (getter in this case) from the actual physical class and not from the @Proxy.proxyClass. When an instance was initially lazy and subsequently loaded, the actually type is HibernateProxy_Javassistxyz and not the actual physical class (say Person).
When trying to access the getter, the invoke operation fails.
The solution is not trivial and would involve finding the referencing getter from the @Proxy.proxyClass class and use this one (exclusively or as a backup?). That's a lot of work though for a very edge case.
I don't really have the necessary cycles to work on it but if someone from the community can step up and provide a solution, I will try and assist.
I'm receiving an IllegalArgumentException while trying to delete an entity that is a part of a @ContainedIn/@IndexedEmbedded relationship. I created a testcase to reproduce the error i'm seeing. The original issue that prompted this was actually a ClassCastException as discussed in this thread
https://forum.hibernate.org/viewtopic.php?f=9&t=1006381
however in creating the test case i was unable to replicate that particular error, but ran into this one, which seemed similar.