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

How to get diff of child Object ? #215

Open
luongbaotin7777 opened this issue Jan 13, 2021 · 1 comment
Open

How to get diff of child Object ? #215

luongbaotin7777 opened this issue Jan 13, 2021 · 1 comment

Comments

@luongbaotin7777
Copy link

Hi bro !, I'm a newbie with java-object-diff. This library is amazing. But when I new object includes a child object, it cannot get diff.
Ex:
TestChild testChild1 = new TestChild();
testChild1.setId(1);
testChild1.setName("testchild1");

    TestChild testChild2 = new TestChild();
    testChild2.setId(2);
    testChild2.setName("testchild2");

    Test test1 = new Test();
    test1.setId(3);
    test1.setColumnName("test1");
    test1.setTestChild(testChild1);

    Test test2 = new Test();
    test2.setId(4);
    test2.setColumnName("test2");
    test2.setTestChild(testChild2);

when I compare the above object, I receive the result: id: 1->2, name:testchild1 -> testchild2, columnName: test1->test2
where id: 3->4 ( of Test object).

And I cannot know which field is changed by child object, which field is changed by the parent object.

Please help me
thank you very much

@luongbaotin7777
Copy link
Author

when I get node path and put it in key Map, I receive: "/indexes[IndexDto(id=436, columnName=taskTypeGuardId, indexName=FKtkwsgk54pvwdi5bd47dk2tx6, indexType=BTREE, isUnique=null, indexSchema=miguards, isPrimary=NO, comment=)]/columnName":
"new": null,
"old": 435

it looks sad

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

No branches or pull requests

1 participant