Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replaced 31 with getClass().hashCode() for Entity hashCode #13097

Merged
merged 2 commits into from
Nov 22, 2020

Conversation

pblanchardie
Copy link
Contributor

Use getClass().hashCode() instead of 31 as Entity hashCode, as mentioned in #10097 (initially #8656).

I noticed that @Shaolans copied this implementation to EntityDTO.hashCode (commit 6a66c40), so I also updated it even if I'm not sure why it absolutely needs to be aligned, as DTOs don't have the same constraints as JPA Entities regarding equals and hashCode.


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@CLAassistant
Copy link

CLAassistant commented Nov 19, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@mshima mshima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pblanchardie
Copy link
Contributor Author

Please let me add a comment in the code before merging.

@DanielFran DanielFran marked this pull request as draft November 19, 2020 21:01
@DanielFran
Copy link
Member

@pblanchardie Can you please add the comment so we can merge it?

@DanielFran DanielFran marked this pull request as ready for review November 22, 2020 19:50
@DanielFran
Copy link
Member

Thanks @pblanchardie for the contribution

Copy link
Member

@DanielFran DanielFran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DanielFran DanielFran merged commit 6caf6e4 into jhipster:main Nov 22, 2020
yelhouti pushed a commit to yelhouti/generator-jhipster that referenced this pull request Nov 24, 2020
replaced 31 with getClass().hashCode() for Entity hashCode
@pascalgrimaud
Copy link
Member

Missing unit tests here

@pascalgrimaud pascalgrimaud added this to the 7.0.0-beta.0 milestone Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants