Skip to content

@Infinite recurive loop through hashSet #1

Description

@Quanderr

Hey! I've spotted you'r bug report on JIRA
https://jira.spring.io/projects/DATAJPA/issues/DATAJPA-1428?filter=allopenissues
Don't have acc there, so i'm, writing here. So, there is no bug in data JPA. This recursive loop is caused by
@ Data lombok annotation. How?
You have an entity which has another entity. When you're using @ Data it's generating by default hashCode method, which is necessary for equals. And default hashCode are hashing not only primitives values but other fields too. So in Role entity this method hash associated Privilege, then hash this Privillege which - has Role. And there is beggining of infinite loop.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions