I have a problem when a graph object is deserialized in the client.
I have two classes, A and B, with a association one-to-many bidirectional. The hashCode() in the class B use an attribute of the class A (not the key, getA().getXXX()). With the debugger i can view that when the instances of B are placed in the set of A, the attribute of B that reference to A is not completely deserialized (is null). The problem ocurr when i want remove an instance of B of the set of A, the actual hashcode of the instance is distinct of the hashcode used when the instance was added to the set. If i return 0 in the hashCode() of B, no problem. Must change the hashCode() of B and don't use properties of A?
Thanks.
Hibernate version:
2.18
|