简体   繁体   English

RequestFactory GWT中EntityProxy中的OneToMany关系

[英]OneToMany relationship in EntityProxy in RequestFactory GWT

I have a problem with EntityProxies in RequestFactory. 我在RequestFactory中的EntityProxies有问题。

@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 . OrganizerEntryProxyEntityProxy而不是ValueProxy

Now, when in service, I send a Day instance to the client with OrganizerEntry List containing OrganizerEntry entities. 现在,在服务中,我将带有包含OrganizerEntry实体的OrganizerEntry列表发送给客户一个Day实例。 When it is received at the client DayProxy.getEntries() returns null. 在客户端收到DayProxy.getEntries()时,它返回null。 Retrieving OrganizerEntity alone works allright. 仅检索OrganizerEntity

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? 我必须在呼叫中添加.with("entries").fire(.这看起来很愚蠢,但是我所拥有的所有信息都来自http://www.gwtproject.org/doc/latest/DevGuideRequestFactory.html和一些HelloWorld Internet示例。RequestFactory是否有更详细的文档?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM