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

An extra UPDATE is triggered when using records #619

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

dyleph
Copy link

@dyleph dyleph commented Apr 24, 2023

No description provided.

@vladmihalcea
Copy link
Owner

Thanks. It's much better. I'll check it out tonight.

@dyleph
Copy link
Author

dyleph commented Apr 24, 2023

Thank you @vladmihalcea . Sorry for late. Because I was in my holiday since Friday :)
Have a nice day!

@vladmihalcea
Copy link
Owner

Likewise

@vladmihalcea
Copy link
Owner

The problem comes from the areEqual method which finds different internal Map types.

@dyleph
Copy link
Author

dyleph commented Apr 25, 2023

Is this problem from hypersistence-utils?

@vladmihalcea
Copy link
Owner

vladmihalcea commented Apr 25, 2023

If you replace the record with a POJO that has equals and hashCode, it will work.

I will see how to accommodate a fix when I get some time.

@vladmihalcea vladmihalcea changed the title Check Book's version after saving An extra UPDATE is triggered when using records Apr 25, 2023
@dyleph
Copy link
Author

dyleph commented May 9, 2023

Hi @vladmihalcea ,
Do we have any updates with this issue?

Regards,
Dy

@vladmihalcea
Copy link
Owner

@dyleph This is a very complex issue, and you are better off using JsonNode or type-safe POJOs on the entity attribute that maps the JSON if you want to avoid it.

I'm not sure when I'll have time to fix it since the problem is caused by records that can be contained on any hierarchical level in a Map of Map structure you're now using.

But, as long as you have some workarounds, you should those instead.

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

Successfully merging this pull request may close these issues.

None yet

2 participants