Re: equals and hashCode methods

2008-03-28 Thread Adam Hardy
caching to hashcode values, but still, understanding and writing a proper equals/hashcode manually looks a much easier/safer path for me. Adam Hardy wrote: I put a superclass on all my entities for a couple of general properties that they all share, and now I'm considering putting my equals() an

Re: equals and hashCode methods

2008-03-27 Thread Kristof Jozsa
s/hashcode manually looks a much easier/safer path for me. my 2c, Kristof Adam Hardy wrote: > I put a superclass on all my entities for a couple of general properties > that they all share, and now I'm considering putting my equals() and > hashCode() methods into the superclass as

equals and hashCode methods

2008-03-26 Thread Adam Hardy
I put a superclass on all my entities for a couple of general properties that they all share, and now I'm considering putting my equals() and hashCode() methods into the superclass as well, with reflection to loop over the array of child methods, calling whatever POJO getters are present.