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

Merge calculates changes incorrectly #2

Closed
ledsoft opened this issue Mar 3, 2017 · 1 comment
Closed

Merge calculates changes incorrectly #2

ledsoft opened this issue Mar 3, 2017 · 1 comment
Assignees
Labels

Comments

@ledsoft
Copy link
Contributor

ledsoft commented Mar 3, 2017

When merging an instance with a reference to another instance, JOPA calculates changes on the reference and considers it a change if any of its attributes have changed, even though it should only check that it is the same instance. An example:

A.hasB = B;
B.name = "Test";
persist(A, B);
B.name = null;
result = merge(A)
=> hasChanges(A) == true, which is wrong, because B is still the same instance.
Correct behavior:
hasChanges(A) == false && result.hasB.name == "Test", because there is no cascading to B, so the value from storage should be used.

@ledsoft
Copy link
Contributor Author

ledsoft commented Mar 20, 2017

Fixed in 0.9.4.

@ledsoft ledsoft closed this as completed Mar 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant