Re: DataRow to CDO comparison

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Nov 14 2008 - 08:48:48 EST

  • Next message: Andrey Razumovsky: "Re: DataRow to CDO comparison"

    Yeah, 'objectFromDataRow' is intended for backend updates of the data
    objects, so it works under assumption that the data in the DataRow is
    a DB data, and after a refresh, the object is still COMMITTED.

    So do you want to compare the values or actually apply all changes to
    the object with the goal of committing them?

    Andrus

    On Nov 13, 2008, at 4:31 PM, Andrey Razumovsky wrote:
    > Suggest I have a DataRow with fresh data which I want to apply to my
    > database, and already a row with same id exists in DB, so
    > CayenneDataObject local = (CayenneDataObject)
    > DataObjectUtils.objectForPK(context, id);
    > is not null.
    >
    > How can I now compare it with a DataRow? It's logical to use
    > DataObject fresh= context.objectFromDataRow(entityName, dataRow,
    > resfresh);
    >
    > BUT:
    > if refresh is false, "fresh" object contains old values (those from
    > local,
    > not from dataRow).
    > if refresh is true, "fresh" and "local" objects get new values, but
    > property
    > change operations are not registered, so context.commitChanges() does
    > nothing.
    >
    > What's the elegant way to refresh object with new dataRow values?



    This archive was generated by hypermail 2.0.0 : Fri Nov 14 2008 - 08:49:26 EST