Hi Thomas,
I watched the DeobfuscatorBuilder and it seems ok. After some tests the 
example that I wrote works but this one no:

@Entity class Document {...}

@Entity class CustomerDocument extends Document{...}
@Entity class CustomerInvoice extends CustomerDocument{...}
@Entity class CustomerCreditNote extends CustomerDocument{...}

@Entity class SupplierDocument extends Document{...}
@Entity class SupplierInvoice extends SupplierDocument {...}
@Entity class SupplierCreditNote extends SupplierDocument {...}

...
@ProxyFor(Document .class) class DocumentProxy extends EntityProxy {...}
@ProxyFor(CustomerDocument.class) class CustomerDocumentProxy extends 
DocumentProxy {...}
@ProxyFor(CustomerInvoice.class) class CustomerInvoiceProxy extends 
CustomerDocumentProxy {...}
...

@Service(value = CustomerDocumentDao.class, locator = DaoLocator.class)
@ExtraTypes({ CustomerInvoice.class, CustomerCreditNote.class })
public interface CustomerDocumentRequest extends RequestContext {
    Request<CustomerDocumentProxy> getStuff(); //
}
...
Request<CustomerDocumentProxy> getStuffRequest = request.getStuff();
getStuffRequest.fire(new Receiver<CustomerDocumentProxy>() {
    @Override
    public void onSuccess(CustomerDocumentProxy proxy) {
        if(proxy instanceof  CustomerInvoiceProxy){     //HERE IS THE PROBLEM!!
        }else if(proxy instanceof  CustomerInvoiceProxy){}
     }
});

In this case, I want get the customer's documents on the client. On the server, 
with Hibernate, I get the list without problem with the correct type of every 
document.
On the client RF tell me that all entries are of type CustomerDocument insted 
of concrete class that should be CustomerInvoice or CustomerCreditNote.

I hope that my example is enough clear.

Thanks





Il giorno venerdì 24 agosto 2012 10:31:46 UTC+2, Thomas Broyer ha scritto:
>
> 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/-/LYEzH4Wu7AcJ.
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