I have entity classes and these entity classes implement their own equals() function, which just compares the Ids of the classes. Sadly, invoking equals() on a Hibernate proxy initializes it, which is completly useless in my case.
I use javassist as a proxy provider. Is there a way to modify the proxy generation code to not load the entity during an equals call, but instead does something else for me? Can I plug a custom proxy provider in Hibernate?
Please do not start a discussion on how equals should behave in Hibernate, this goes to far, there are different opinions on the topic, which I already know, and is not part of the question :).
It works if you override classes in the hibernate.jar, and providing your own Implementation of BasicLazyInitializer.