Wednesday, October 26, 2016

Unchanged transient field received as null on server using RequestFactory - how to force to send?

Hi all...

So I have a situation where we have an entity persisted with JPA on the server:

public class MyEntity ... {
    private String field1;
    private String field2;
    @Transient
    private String myTransientField;
}

... and we have a proxy:

public class MyEntityProxy ... {
    public String getField1();
    public void setField1(String field1);
    public String getField2();
    public void setField2(String field2);
    public String getMyTransientField();
    public void setMyTransientField(String myTransientField);
}

When I first make a call to the server to persist the entity, it works fine.

However, if I load it to edit it, and don't change myTransientField, myTransientField arrives on the server as a null value.

I had *thought* I had this working in the past, but for some reason I see it breaking now.

Is this the way it's supposed to work? (since the field hasn't changed, or because it's transient, or both)

If so, how can I get around this restriction, and force that field to be dirty, even if it is unchanged?

- Tim

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment