Is it possible to make the default Eclipse "Generate hashCode() and equals()" use getters instead of field references? - ie. can I get at the template that it uses?
I'm using Hibernate, and Proxied Objects are only LazyLoaded when getters are used and not from field references. It's an annoyance to be constantly changing it.
The obvious workarounds are to create a template myself or write a plugin - which feels like overkill.
It's not a solution, rather workaround - but you might try generate equals()
, then use 'encapsulate field' refactoring to replace all field acceses to use getters/setters (it works inside class also).