I hate to raise natural key/surrogate key again, but maybe there’s an easy answer to this question. With 1.9, we make all of our .equals routines compare uuids, which basically says that .equals is an identity test. I have started implementing Comparable on my data access POJOs because in many cases their natural order depends on names of concepts or locations referenced by the POJO, so I can’t sort on this order when returning a list of POJOs, instead I put the returned list through Collections.sort. However, this means that compare and equals are not consistent because the natural order may not be unique, and I understand this not to be a desirable situation. Is implementing Comparable a bad approach? Do I need to add ID or some other field to make the natural order unique? Is this not something to worry about? Saludos, Roger
[OPENMRS-DEV] Equals and Compare for OpenMRS objects
Friedman, Roger (CDC/CGH/DGHA) (CTR) Sun, 22 Jan 2012 11:02:30 -0800
- [OPENMRS-DEV] Equals and Compare for ... Friedman, Roger (CDC/CGH/DGHA) (CTR)
- Re: [OPENMRS-DEV] Equals and Com... Ben Wolfe
- Re: [OPENMRS-DEV] Equals and... Darius Jazayeri
- Re: [OPENMRS-DEV] Equals... Friedman, Roger (CDC/CGH/DGHA) (CTR)

