{"action":"created","issue":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/4027","repository_url":"https://api.github.com/repos/jhipster/generator-jhipster","labels_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/4027/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/4027/comments","events_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/4027/events","html_url":"https://github.com/jhipster/generator-jhipster/issues/4027","id":173232249,"number":4027,"title":"Generate a unique business key in entities","user":{"login":"cbornet","id":11633333,"avatar_url":"https://avatars.githubusercontent.com/u/11633333?v=3","gravatar_id":"","url":"https://api.github.com/users/cbornet","html_url":"https://github.com/cbornet","followers_url":"https://api.github.com/users/cbornet/followers","following_url":"https://api.github.com/users/cbornet/following{/other_user}","gists_url":"https://api.github.com/users/cbornet/gists{/gist_id}","starred_url":"https://api.github.com/users/cbornet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbornet/subscriptions","organizations_url":"https://api.github.com/users/cbornet/orgs","repos_url":"https://api.github.com/users/cbornet/repos","events_url":"https://api.github.com/users/cbornet/events{/privacy}","received_events_url":"https://api.github.com/users/cbornet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-08-25T15:19:04Z","updated_at":"2016-08-25T15:56:21Z","closed_at":null,"body":"Our current hashCode() and equals() methods are based on the auto-generated id which can lead to bad side effects. Thus it is recommended to use a unique immutable \"business key\" to implement them.\r\nSee https://vladmihalcea.com/2013/10/23/hibernate-facts-equals-and-hashcode/\r\n\r\nThe alternative but with an impact on performance for large collections would be to use a fixed hashCode. See https://vladmihalcea.com/2016/06/06/how-to-implement-equals-and-hashcode-using-the-entity-identifier/"},"comment":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/comments/242440019","html_url":"https://github.com/jhipster/generator-jhipster/issues/4027#issuecomment-242440019","issue_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/4027","id":242440019,"user":{"login":"cbornet","id":11633333,"avatar_url":"https://avatars.githubusercontent.com/u/11633333?v=3","gravatar_id":"","url":"https://api.github.com/users/cbornet","html_url":"https://github.com/cbornet","followers_url":"https://api.github.com/users/cbornet/followers","following_url":"https://api.github.com/users/cbornet/following{/other_user}","gists_url":"https://api.github.com/users/cbornet/gists{/gist_id}","starred_url":"https://api.github.com/users/cbornet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbornet/subscriptions","organizations_url":"https://api.github.com/users/cbornet/orgs","repos_url":"https://api.github.com/users/cbornet/repos","events_url":"https://api.github.com/users/cbornet/events{/privacy}","received_events_url":"https://api.github.com/users/cbornet/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T15:56:21Z","updated_at":"2016-08-25T15:56:21Z","body":"Something like\r\n```java\r\n    @Column(name=\"__UUID__\", unique=true, nullable=false, updatable=false, length = 36)\r\n    private String uuid = java.util.UUID.randomUUID().toString();\r\n```"}}
{"actor":{"display_login":"cbornet"}}