GWT 2.4.0 RequestFactory多态性

And*_*lov 5 java polymorphism requestfactory gwt-2.4

GWT 2.4是否支持这种情况:

@Entity class MyBase {...}
@Entity class MyChild1 extends MyBase {...}
@Entity class MyChild2 extends MyBase {...}
...
@ProxyFor(MyBase.class) class MyBaseProxy extends EntityProxy {...}
@ProxyFor(MyChild1.class) class MyChild1Proxy extends MyBaseProxy {...}
@ProxyFor(MyChild2.class) class MyChild2Proxy extends MyBaseProxy {...}
...
@Service(ArticleBase.class)
public interface MyBaseRequest extends RequestContext {
    Request<MyBaseProxy> getStuff(); // MyChild1 here
}
...
Request<MyBaseProxy> getStuffRequest = request.getStuff();
getStuffRequest.fire(new Receiver<MyBaseProxy>() {
    @Override
    public void onSuccess(MyBaseProxy proxy) {
        button.setText(((MyChild1Proxy)proxy).getQwerty()); // HERE!
    }
});
Run Code Online (Sandbox Code Playgroud)

问题是,我无法使其发挥作用.它要么不支持,要么我需要在某处添加一些魔法注释.当我使用具体类型时,一切正常,但如果我使用基本类型,它就不起作用.

你怎么看?

And*_*lov 10

修复它@ExtraTypes:

@Service(ArticleBase.class)
@ExtraTypes({MyChild1Proxy.class, MyChild2Proxy.class})
public interface MyBaseRequest extends RequestContext {
    Request<MyBaseProxy> getStuff(); // MyChild1 here
}
Run Code Online (Sandbox Code Playgroud)