Re: DataObject changes - before commit

2018-09-13 Thread Matt R Watson
True, thanks for the suggestions John. I agree with your assessment of code costs vs memories costs > On Sep 12, 2018, at 2:42 PM, John Huss wrote: > > Or I suppose you could create fields for each of the original values in the > same way that the current values are stored. > > On Wed, Sep 12,

Re: DataObject changes - before commit

2018-09-12 Thread John Huss
Or I suppose you could create fields for each of the original values in the same way that the current values are stored. On Wed, Sep 12, 2018 at 4:32 PM John Huss wrote: > Cayenne stores the original values, but they are in DbEntity > representation rather than ObjEntity representation which mak

Re: DataObject changes - before commit

2018-09-12 Thread John Huss
Cayenne stores the original values, but they are in DbEntity representation rather than ObjEntity representation which makes comparing the two difficult. Without writing a lot of code to convert and compare your best bet would be to use a more efficient data structure without any extra unneeded spa

Re: DataObject changes - before commit

2018-09-11 Thread Matt R Watson
Thanks mrg. I am aware that Cayenne knows about the original values, but trying to find an efficient way to access them. Or at least more efficient than the Map we are currently using, which is heavy on memory yet quick on access time (and easy to read code). I’ve seen your utilities in the pas

Re: DataObject changes - before commit

2018-09-11 Thread Michael Gentry
Hi Matt, Cayenne already keeps track of the original values for you. This is needed in order to do optimistic locking, plus it allows Cayenne to only send over changes in a record instead of the entire record when you are doing an UPDATE. I haven't tried this approach on the field-based version

DataObject changes - before commit

2018-09-10 Thread Matt R Watson
Now that the DataObject classes are “field based”, I would like to find a way to replace the heavy Map we have placed on all of our DataObject classes. We extend Cayenne’s default class and added a HashMap to keep track of the original values (as it changes) since the object has been loaded and