spring-attic / spring-sync

Enables efficient communication and data synchronization between clients and Spring server applications.
Apache License 2.0
107 stars 44 forks source link

Parent object with collection fields add or delete not generating the correct patch #10

Closed Veena11 closed 9 years ago

Veena11 commented 9 years ago

Hi, I am trying to use SpringSync -> newDiff().diff() with two entities, at parent level, the entity is a non List, but at field level, i have multiple lists.When i checked the Diff class source code, if the entity passed at parent level is not a list , diffList() is not invoked which is expected, but this method is not invoked even for the fields which are lists. Because of this , if the modified entity has a collection with some add or delete ,patch is generated with operation : replace for the field size. Ideally this should have been an operation:add or operation: remove . Please correct me if am wrong in my understanding and also help me tackle this situation. Thanks in advance

habuma commented 9 years ago

This is fixed and in the latest spring-sync snapshot builds. Be aware, however, that the structure of spring-sync has changed. A few packages have moved around and there are now 3 main artifacts (spring-sync-core, spring-sync-web, and spring-sync-config) along with spring-sync-android.

Veena11 commented 9 years ago

Thanks Craig !!. Will this fix handle a list field being a collection of sub class objects-> which in turn will have list of nested level class objects / other collections and non list fields? Basically a complex object graph ? Regards Veena