EntityProxy Returns Null for Collection Properties
My EntityProxy looks like this
@ProxyFor ( User.class )
public interface UserProxy extends EntityProxy {
Long getId();
String getFirstname();
String getLastname();
Set<String> getAddresses();
void setAddresses( Set<String> addresses );
}
And my Entity class look like this:
@Entity
public class User {
@Id
@GeneratedValue ( strategy = GenerationType.IDENTITY )
private Long id;
@NotNull
private String firstname;
@NotNull
private String lastname;
private Set<String> addresses;
public void setAddresses( Set<String> addresses ) {
this.addresses = addresses;
}
public Set<String> getAddresses() {
if ( addresses == null ) {
addresses = new HashSet<String>();
}
return addresses;
}
}
When I make a request using RequestFactory like so:
Request<UserProxy> createReq = request.authenticate().using(user);
createReq.fire(new Receiver<UserProxy>() {
@Override
public void onSuccess( UserProxy authenticatedUser ) {
System.out.println(authenticatedUser.getFirstname()); //
prints "First name of Person" as expected
System.out.println(authenticatedUser.getAddresses().size()); // prints
0 instead of the no. of addresses, which is more than 0 for this user
}
});
I am using JPA on app engine.
It look like RequestFactoryServlet is not able to properly serialize
collection properties of datastore objects. Any help in this regard
would be greatly appreciated.
Thanks,
Gaurav
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home