All I can say is that it's nothing to do with the use of a ServiceLocator, 
and that it works for me.
Can you look at the DeobfuscatorBuilder generated by ValidationTool? (if 
you configured annotation processing in Eclipse, look at the .apt_generated 
folder, otherwise use the "apt" tool from the JDK (or javac) with the "-s" 
argument to write the generated source to disk) Does it look OK wrt 
client/server-classes mappings?
Alternately, could you set a breakpoint in 
com.google.web.bindery.server.ResolverServiceLayer#resolveClientType and 
try to understand why it chooses MyBaseProxy for a MyChild1 object instead 
of MyChild1Proxy?

On Wednesday, August 22, 2012 6:06:25 PM UTC+2, bond wrote:
>
> Hi,
> I'd like to use polymorphic type mapping with use of Locator.
>
> I'm in this situation:
>
> @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(value = MyBaseRequestDao.class, locator = DaoLocator.class)
> @ExtraTypes({ MyChild1.class, MyChild2.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) {
>         if(proxy instanceof  MyChild1Proxy)           
> button.setText(((MyChild1Proxy)proxy).getQwerty()); // HERE!
>     }
> });
>
> I'm using Hibernate on the server and in the server (on my MyBaseRequestDao) 
> I can see the correct type of objects. On the client instead the polymorphic 
> mapping seems don't work.
>
> Maybe the problem is the use of locator?
>
> Thanks very much 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/uCgt_ThAHa0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to