GWT 2.4.0 RequestFactory多态性

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 getStuff(); // MyChild1 here } ... Request getStuffRequest = request.getStuff(); getStuffRequest.fire(new Receiver() { @Override public void onSuccess(MyBaseProxy proxy) { button.setText(((MyChild1Proxy)proxy).getQwerty()); // HERE! } }); 

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

你怎么看?

修复了@ExtraTypes

 @Service(ArticleBase.class) @ExtraTypes({MyChild1Proxy.class, MyChild2Proxy.class}) public interface MyBaseRequest extends RequestContext { Request getStuff(); // MyChild1 here } 
Interesting Posts