-
Notifications
You must be signed in to change notification settings - Fork 198
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
Relationships OneToOne using proxies are incorrectly marked as dirty #1294
Comments
@mvinas1977 I think all tests would pass when you define equals and hashCode for |
A better solution would be to
|
puneetbehl
added a commit
that referenced
this issue
Apr 30, 2020
to demonstrate the need to override equals method for correctly marking association as dirty or not.
puneetbehl
added a commit
that referenced
this issue
Apr 30, 2020
* Cleanup and remove redundant code. * Update implementation of markDirty to consider EntityProxy and update the comparison operation accordingly.
puneetbehl
added a commit
that referenced
this issue
May 7, 2020
puneetbehl
added a commit
to grails/gorm-hibernate5
that referenced
this issue
May 8, 2020
puneetbehl
added a commit
to grails/gorm-mongodb
that referenced
this issue
May 8, 2020
This was referenced May 8, 2020
puneetbehl
added a commit
to grails/gorm-hibernate5
that referenced
this issue
May 8, 2020
…ing association
puneetbehl
added a commit
to grails/gorm-mongodb
that referenced
this issue
May 8, 2020
…ing association
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Let’s take a look the following example. We have these domain objects
So, you get a book from db
TestBook book = TestBook.get(someId)
At this Point book.author is a proxy, that is ok. If during binding author is set with same value it previously had it will we marked as dirty
No Mather if you set the proxy
book.author = book.author
Or a new copy of the same Author
book.author = TestBook.get(book.author.id)
In both cases author is marked as dirty
Expected Behaviour
Since book is same instance author property should not marked as dirty
Actual Behaviour
Author is incorrectly marked as dirty
Updated DirtyCheckingSpec to reproduce the issue
This issue is reproducible in 6.1.x 7.x and master
#1296 PR with fix for 6.1
#1298 PR with fix fot 7.x
#1297 PR with fix for master
The text was updated successfully, but these errors were encountered: