I have had a lot of problems in impelementing equals/hashcode, particularly on entities that I wanted to include in a set. I found at one stage that hibernate was instantiating the entity, adding it to the set, and only then setting its properties. The net result is that the hashcode changed between the time the entity was added and it was accessed. I'm afraid I just gave up and returned 0 as the hashcode for all persistent entities....
Mike On 7/27/07, Daniel.Rodriguez <[EMAIL PROTECTED]> wrote: > > > Matt & Michael, > > It seems I finally found a solution > > Checking again thru the logs I noticed that the exception was raised > everytime that my entity hashcode's method was called. > So I rechecked the Hibernate folks discussion on Equals and Hashcodes at > http://www.hibernate.org/109.html. > > What I basically did was that I modified commonclipse hashcode to remove > the > references to the conflicting collection. Voila, that did the job (and > according to my junit tests, it works flawlessly so far). > > I also read about using UUID in the Equals/Hashcode on the same site. > > It's not ideal (it's a JUST WORKS tm solution) so I wanted to hear what > are > your opinions on the matter. > > Thanks. > -- > View this message in context: > http://www.nabble.com/LazyInitializationException%3A-illegal-access-to-loading-collection....-tf4152650s2369.html#a11833906 > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >