John,

Currently, @ProxyFor must reference the Entity itself, which, in
2.1.0, required you to put static methods on the entity to do
persistence operations. However, you can use the new Locator and
ServiceLocator in 2.1.1 to move persistence methods out of the entity
into an entity service (perhaps a DAO). I just put up some example
code at http://code.google.com/p/listwidget. It's definitely a work in
progress (== not pretty yet), but the RF stuff there works.

/dmc

On Fri, Jan 7, 2011 at 1:37 PM, John Maitland
<jfgmaitl...@googlemail.com> wrote:
> I’m having a problem using the new RequestFactory feature in 2.1.1
> when trying to serialise an object, using the EntityProxy, with using
> it's interface. If I have the following entity proxy, entity interface
> and its implementation, a ‘UnexpectedException: The domain type
> com.server.MyEntity cannot be sent to the client’.
>
> @ProxyFor(value = MyEntity.class)
> public interface MyEntityProxy extends EntityProxy {
>    String getAProperty();
> }
>
> public class MyEntityImpl implements MyEntity {
> ....
> }
>
> public interface MyEntity {
>   String getAProperty();
> }
>
> This doesn’t work, because the getSupertypes method in the
> RequestFactoryInterfaceValidator return a list of the following types:
>   - Lcom/server/MyEntityImpl
>   - Ljava/lang/Object;
>   - Lcom/server/MyEntity
>
> And getEntityProxyTypeName in RequestFactoryInterfaceValidator breaks
> from the supertypes upcast loop if an object type is found before the
> required type defined on the entityproxy (i.e. never reaches my
> interface).
>
> If I change the value of the ProxyFor from the interface to its
> implementation then it works (i.e. @ProxyFor(MyEntityImpl.class),
> which is not desirable.
>
> Does anyone know if this is possible or a limitation?
>
> Regards,
> John
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-tool...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>



-- 
David Chandler
Developer Programs Engineer, Google Web Toolkit
w: http://code.google.com/
b: http://googlewebtoolkit.blogspot.com/
t: @googledevtools

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to