You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some JPA entities currently use the Project Lombok @EqualsAndHashCode annotation to auto-generate equals() and hashCode() overrides respectively. However, there are some pitfalls in doing so, some of which were encountered during unit test conversion.
It would seem that some Java community discussions (example, among others) recommend manually overriding equals() and hashCode() so as to make behavior more predictable when comparing objects or using JPA lifecycle management. Based on this, it may be possible to run into these issues once two entities are compared, leading to unexpected behavior.
This ticket is to investigate whether removal of these annotations from JPA entities in HIRS is necessary, and if so, to remove them and replace them with equals() and hashCode() implementations as found in master. Afterwards, we may need to copy over the corresponding portions of unit tests from master for these methods to ensure consistency.
The text was updated successfully, but these errors were encountered:
Some JPA entities currently use the Project Lombok
@EqualsAndHashCode
annotation to auto-generateequals()
andhashCode()
overrides respectively. However, there are some pitfalls in doing so, some of which were encountered during unit test conversion.It would seem that some Java community discussions (example, among others) recommend manually overriding
equals()
andhashCode()
so as to make behavior more predictable when comparing objects or using JPA lifecycle management. Based on this, it may be possible to run into these issues once two entities are compared, leading to unexpected behavior.This ticket is to investigate whether removal of these annotations from JPA entities in HIRS is necessary, and if so, to remove them and replace them with
equals()
andhashCode()
implementations as found inmaster
. Afterwards, we may need to copy over the corresponding portions of unit tests frommaster
for these methods to ensure consistency.The text was updated successfully, but these errors were encountered: