You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Øyvind Harboe <oy...@zylin.com> on 2006/06/24 09:35:48 UTC

What's the replacement for QueryUtils.updatedProperties()?

I have failed to google up the raplacement for this method... Anyone?

It would be convenient to simply determine whether a property has
changed or not...


QueryUtils.updatedProperties(DataObject dataObject)
          Returns a map of the properties of dataObject which have
actually changed compared to the objects commited snapshot.

 Deprecated. Since 1.1 unused

-- 
Øyvind Harboe
http://www.zylin.com

Re: What's the replacement for QueryUtils.updatedProperties()?

Posted by Øyvind Harboe <oy...@zylin.com>.
On 6/26/06, Andrus Adamchik <an...@objectstyle.org> wrote:
> There is no replacement.
>
> There is a non-public API in the ObjectStore that provides access to
> the ObjectDiff:
>
> ObjectDiff diff = dataContext.getObjectStore().getChangesByObjectId
> ().get(oid);
> Object oldValue = diff.getSnapshotValue("property");
>
> You can use it by creating your own utility class in the
> org.objectstyle.cayenne.access package. But use it at your own risk,
> as non-public methods are not guaranteed to be preserved (or even
> deprecated properly).

Thanks!

I'm going to go ahead and assume at my own risk that it will be
possible to do this in Cayenne 3.0 as well somehow using some API or
other. :-)

>
> Andrus

-- 
Øyvind Harboe
http://www.zylin.com

Re: What's the replacement for QueryUtils.updatedProperties()?

Posted by Andrus Adamchik <an...@objectstyle.org>.
There is no replacement.

There is a non-public API in the ObjectStore that provides access to  
the ObjectDiff:

ObjectDiff diff = dataContext.getObjectStore().getChangesByObjectId 
().get(oid);
Object oldValue = diff.getSnapshotValue("property");

You can use it by creating your own utility class in the  
org.objectstyle.cayenne.access package. But use it at your own risk,  
as non-public methods are not guaranteed to be preserved (or even  
deprecated properly).

Andrus


On Jun 24, 2006, at 11:35 AM, Øyvind Harboe wrote:

> I have failed to google up the raplacement for this method... Anyone?
>
> It would be convenient to simply determine whether a property has
> changed or not...
>
>
> QueryUtils.updatedProperties(DataObject dataObject)
>          Returns a map of the properties of dataObject which have
> actually changed compared to the objects commited snapshot.
>
> Deprecated. Since 1.1 unused
>
> -- 
> Øyvind Harboe
> http://www.zylin.com
>