I'm assuming that Person and Address are actual entities (with @Id
fields) in your example.
Unfortunately there isn't a great story for this right now (that is,
serializing large entity object graphs back and forth with GWT). IIRC,
Ref will serialize the reference _to_ gwt clients but isn't quite
smart enough to serialize it back - although check this to be sure.
One option is to use @OnLoad and @Ignore to essentially copy the field manually:
class Person implements Serializable {
@Ignore Address addressEntity;
@Load Ref<Address> address;
@OnLoad public void copyAddress() {
addressEntity = address.get();
}
}
Something like this should give you most of the GWT serialization you
are looking for.
In the long run, Objectify will have a @Reference annotation that will
let you use Address directly instead of Ref, but there will be some
constraints (for example, the entity pointed at must exist).
Jeff
(back in SF now, still going through my inbox - it will take a couple
days before I'm fully caught up).
>>> email to
objectify-appen...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups
> "objectify-appengine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
objectify-appen...@googlegroups.com.