cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Razumovsky" <razumovsky.and...@gmail.com>
Subject Re: RefreshQuery not supports insert/delete?
Date Tue, 24 Jun 2008 16:31:54 GMT
Hi Andrus!

I can now see it too, just somewhy it was delivering for more than an hour.
Dev list accepts messages immediately.

I managed to do some workaround. After the refresh, i do:

Collection objects = context.getGraphManager().registeredNodes();
for (Object o : objects)
{
  if (o instanceof Uch)
  {
    ((Uch) o).invalidateProperty(Uch.APKMEASURE_ARRAY_PROPERTY);
  }
  else if ...
}

where "invalidateProperty" is a method in my client entity superclass:
/**
* Marks specified property as a candidate to reload
* @param property Property name
*/
public void invalidateProperty(String property)
{
  EntityResolver resolver = objectContext.getEntityResolver();
  ClassDescriptor descriptor =
resolver.getClassDescriptor(objectId.getEntityName());

  Property propertyDescriptor = descriptor.getProperty(property);
  ValueHolder prop = (ValueHolder)
propertyDescriptor.readPropertyDirectly(this);

  if (prop != null)
  {
    prop.invalidate();
  }
}

That causes property to refetch next time it is addressed. Works fine for
me, but only because i do exactly know what relationships of what entities
can be
modified my side apllication. I'm short of time now, so this
implementation will go.
However, I think, this is a bug.

Andrey

2008/6/24, Andrus Adamchik <andrus@objectstyle.org>:
>
>
> On Jun 24, 2008, at 3:36 PM, Andrey Razumovsky wrote:
>
> [Something's wrong with user list]
>>
>
> Andrey,
>
> I saw your message delivered there. I don't think anything is wrong with
> it.
>
> Andrus
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message