In section 19.1.3 of the v3 documentation it says:
Quote:
Certain operations do not require proxy initialization
* equals(), if the persistent class does not override equals()
* hashCode(), if the persistent class does not override hashCode()
* The identifier getter method
Hibernate will detect persistent classes that override equals() or hashCode().
I can't find any documentation explaining why the proxy would need to be initialized if the persistent class overrides equals() or hashCode(). Can anyone send me a reference? I can't understand why that is a requirement. My equals() and hashCode() methods only call the primary key getter method.
My problem is this:
I have a main class A that contains a Set of another class B. Because B is used in a set, it has to define its own equals() and hashCode() methods. Because of the limitation above, I can't perform operations on a Set of B proxy objects without them being initialized, even though the only information I need from them is the primary key of B.
Can anyone tell me how to fix this? At present hibernate is loading all of the details of B unnecessarily.
I'm using Hibernate 3.2.5
Thanks
Martin