Problems with Proxies

65 views
Skip to first unread message

Geoff Gibbs

unread,
May 16, 2012, 4:02:25 AM5/16/12
to google-we...@googlegroups.com
I'm trying to create a proxy for a class containing a collection of classes that all extend from a generic abstract class:

Here's the model structure:

@Entity
public class Container {
  public Set<SuperType<?>> getContent();
}


@Entity
public abstract class SuperType<T> {}

@Entity
public class SubOne extends SuperType<Something> {}

@Entity
public class SubTwo extends SuperType<SomethingElse> {}

@Entity
public class SubThree extends SuperType<Other> {}

My Proxy classes:

@ProxyFor(Container.class)
@ExtraTypes({SubOne.class, SubTwo.class, SubThree.class})
public interface ContainerProxy {
  Set<SuperTypeProxy> getContent();
}

@ProxyFor(SuperType.class)
public interface  SuperTypeProxy {}

@ProxyFor(SubOne.class)
public interface SubOneProxy extends SuperTypeProxy {}

@ProxyFor(SubTwo.class)
public interface  SubTwo Proxy extends SuperTypeProxy {}

@ProxyFor(SubThree.class)
public interface  SubThree Proxy extends SuperTypeProxy {}

The problem is that when building I get the following warning and the build fails:

...ContainerProxy.java:xx: Could not find domain method similar to java.util.Set<SuperType<T>> getContent()

If I remove that method from the proxy, then the build succeeds. Is there any way to get this to work that does not involve changing the model?

Markenson França

unread,
May 17, 2012, 2:39:05 PM5/17/12
to google-we...@googlegroups.com
I have used the @ExtraTypes annotation on the interface that extends RequestFactory and has worked fine for me.

ex:

@ ExtraTypes ({SubOne.class, SubTwo.class, SubThree.class})
public interface extends YourRequestFactory RequestFactory {

....
}

Atenciosamente,
Markenson Paulo França


2012/5/16 Geoff Gibbs <ge...@studiogibbs.com>

--
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/-/eaQ2FvLcoiMJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Reply all
Reply to author
Forward
0 new messages