Just to clarify the last statement, I'm talking about something like this:

interface AProxy extends EntityProxy, HasCode, IsIdentifiable {
}

@ProxyFor(SomeEntity.class)
interface SomeProxy extends AProxy {
   ...
}

@ProxyFor(SomeOtherEntity.class)
interface SomeOtherProxy extends AProxy {
   ...
}

Since AProxy doesn't actually have a concrete type to map to, it doesn't
need a ProxyFor annotation.
SomeEntity, and SomeOtherEntity could implement HasCode & IsIdentifiable,
or they could just have methods that match the signatures. See the 'Type
mapping' section here:
http://code.google.com/p/google-web-toolkit/wiki/RequestFactory_2_4#Polymorphism_support
for
all the details !


On Mon, Mar 12, 2012 at 12:17 PM, Aidan O'Kelly <[email protected]> wrote:

> @ProxyFor(AProxy.class)
> interface AProxy extends ...
>
> A proxy that is mapping to itself ! This won't work, the @ProxyFor
> annotation needs to map to a concrete class. If there is no concrete class
> (ie, you re-using this interface for many different proxies) you don't need
> a @ProxyFor annotation at all.
>
>
> On Mon, Mar 12, 2012 at 9:45 AM, Romain BIARD <[email protected]>wrote:
>
>> Hi all,
>>
>> I'm trying to do this kind of things:
>>
>> interface HasCode{
>>
>>  void setCode(String code);
>>
>>  String getCode();
>> }
>>
>> interface IsIdentifiable{
>>
>>  void setId(Long id);
>>
>>  Long getId();
>>
>>  Integer getVersion();
>>
>>  void setVersion(Integer version);
>> }
>>
>> @ProxyFor(AProxy.class)
>> interface AProxy extends EntityProxy,HasCode,IsIdentifiable{
>>
>> }
>>
>> Of course, these interfaces have been placed in my shared package and
>> I use them for my concretes entity classes on back side.
>> On Validation I have an error like this :
>>
>> [INFO] diagnostic /src/main/java/com/test/cis/toto/shared/api/
>> HasLabel.java:6: Could not find domain method similar to void
>> setLabel(java.lang.String)
>> [INFO] diagnostic /src/main/java/com/test/cis/toto/shared/api/
>> HasLabel.java:8: Could not find domain method similar to
>> java.lang.String getLabel()
>>
>> I didn't manage to find what is wrong. Can I do this or interface
>> composition has to be done only with interfaces which represents
>> concrete/abstract classes on the server ?
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Web Toolkit" group.
>> 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.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
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