You can do it for to-one relationships, as snapshot will contain the FK value that corresponds to the related object PK. You won't be able to do it for to-many. Hopefully we'll expose API for a more direct change tracking soon [1, 2] that should include all relationship changes and won't require decoding of snapshots.
Andrus [1] https://lists.apache.org/thread.html/2e494d6b7fafbeadd1a41b5d647d82438c7a0591ed87b4f3b4b3e20b@%3Cdev.cayenne.apache.org%3E [2] https://stackoverflow.com/questions/58318730/what-is-the-current-best-method-of-getting-the-changes-to-an-object-hierarchy-in > On Oct 7, 2019, at 2:05 PM, Lon Varscsak <[email protected]> wrote: > > Is there any way to get the values of relationships from snapshots? I know > how to do it for attributes, but can't seem to figure out how to do it for > relationships. > > Thanks, > > Lon
