The problem is inside in JsonRequestProcessor in the method updatePropertyTypes

It's using entity.getDeclaredFields() which will omit all inherited fields.

On Fri, Oct 1, 2010 at 5:24 PM, Pascal Patry <[email protected]> wrote:
> I'm currently having 2 issues with "JsonRequestProcessor.validateKeys()".
> These requests are coming from updates that we want to perform on entities
> that are driven by EntityProxy.
>
> The first issue is with inheritance. We have a base class for all our
> entities on the server side in order to not have to replicate common
> fields like the last update timestamp, the creation timestamp or even
> the container id. So, on the concrete Entity, there are no containerId
> field, but the client can send this data to the server in the update
> request. When this happens, we encounter an exception on the server.
>
> "Error: key containerId is not permitted to be set"
>
> It seems that the validator is not picking up properties coming from the
> inherited base entity class. getContainerId() and setContainerId() with
> proper signature are present on the concrete entity.
>
>
> The second issue we are getting is related to the same validation and
> is producing the same exception. We have transient functions in some
> entities to fill our needs. Let's take an example where the UserAccount
> has a birth date set on the entity, but we only want to expose the age
> of it when a client list these entities. We then have the proper getAge()
> function on UserAccount that is a transient property that we compute on
> the fly. When some changes are applied to a UserAccountEntityProxy from
> an Editor, we use RequestFactoryEditorDriver to drive the update which
> will carry this transient property back to the server. So, when
> validation occurs on this field, it will be rejected because "the key
> is not permitted to be set", which is true, but which we really don't care
> about. I can create a dummy setter and field to get passed the issue,
> but this is really annoying and misleading.
>
> --
> http://groups.google.com/group/Google-Web-Toolkit-Contributors

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to