I have a problem with EntityProxies in RequestFactory.
@ProxyFor(value=Day.class, locator = DayLocator.class)
public interface DayProxy extends EntityProxy{
List<OrganizerEntryProxy> getEntries();
void setEntries(List<OrganizerEntryProxy> entries);
etc...
}
Entity:
public class Day implements Serializable {
private List<OrganizerEntry> entries;
etc...
public List<OrganizerEntry> getEntries(){
return Collections.unmodifiableList(entries);
}
public void setEntries(List<OrganizerEntry> entries){
this.entries = entries;
}
etc....
}
OrganizerEntryProxy
is EntityProxy
not ValueProxy
.
Now, when in service, I send a Day
instance to the client with OrganizerEntry
List containing OrganizerEntry
entities. When it is received at the client DayProxy.getEntries()
returns null. Retrieving OrganizerEntity
alone works allright.
What am I doing wrong?
Hah, mystery unveiled. It was rather basic problem. I had to add .with("entries").fire(.
. to the call. It seems stupid but all the information I had was from http://www.gwtproject.org/doc/latest/DevGuideRequestFactory.html and some HelloWorld internet examples. Is there more detailed documentation to RequestFactory?