Hi all!
I was doing some work while I found what's following:
Code:
log.debug("Child Parent: " + admAreaChild.getAddressAdministrativeArea().getIdAdministrativeArea());
log.debug("PArent id: " + admAreaParent.getIdAdministrativeArea());
log.debug((admAreaChild.getAddressAdministrativeArea().getIdAdministrativeArea() == admAreaParent.getIdAdministrativeArea()));
The result is very curious:
Code:
15:04:00,523 DEBUG com.level2crm.services.addressvalidator.AddressValidator - Child Parent: 4
15:04:00,523 DEBUG com.level2crm.services.addressvalidator.AddressValidator - PArent id: 4
15:04:00,523 DEBUG com.level2crm.services.addressvalidator.AddressValidator - false
So the question is. If both id's are equal and integers why it returns false on equality compartion?
NOTE: I found that it works with .equal. May it be related to Integer to Integer comparation. Maybe has nothing to do with Hibernate...
Thank you all.