enhanced classes. You can write a custom decorator and override the
appropriate methods.
Here's my implementation - to get you started:
public class GuiceDecorator extends ServiceLayerDecorator {
@Override
public Class<? extends Locator<?, ?>> resolveLocator(Class<?>
domainType) {
if(domainType.getName().contains("Guice"))
return super.resolveLocator(domainType.getSuperclass());
return super.resolveLocator(domainType);
}
@Override
public <T> Class<? extends T> resolveClientType(Class<?> domainClass,
Class<T> clientType, boolean required) {
if(domainClass.getName().contains("Guice"))
return super.resolveClientType(domainClass.getSuperclass(),
clientType, required);
return super.resolveClientType(domainClass, clientType, required);
}
@Override
public <T extends Locator<?, ?>> T createLocator(Class<T> clazz) {
return GuiceConfig.getInjectorReference().getInstance(clazz);
}
}
On 28 Mar, 23:43, Stefan <sbara...@gmail.com> wrote:
> Hi Guys,
>
> I am having an issue using GWT 2.2 RequestFactory and Hibernate 3.6.
> My domain model is looks like this:
>
> class Bar {
> Long id;
> String title;
> Foo foo;
>
> }
>
> class Foo {
> Long.id;
> String title;
>
> }
>
> So, I am trying to populate a CellTable using request factory with
> Bar.id, Bar.title, Bar.foo.id. The domain model is constructed from
> the database using JPA/Hibernate. The problem I am getting is:
>
> com.google.gwt.requestfactory.server.UnexpectedException: The domain
> type Foo_$$_javassist_45 cannot be sent to the client
> at
> com.google.gwt.requestfactory.server.ServiceLayerDecorator.die(ServiceLayerDecorator.java:
> 185)
> at
> com.google.gwt.requestfactory.server.ResolverServiceLayer.resolveClientType(ResolverServiceLayer.java:
> 91)
> at
> com.google.gwt.requestfactory.server.ServiceLayerDecorator.resolveClientType(ServiceLayerDecorator.java:
> 122)
> at
> com.google.gwt.requestfactory.server.ServiceLayerDecorator.resolveClientType(ServiceLayerDecorator.java:
> 122)
>
> It appears that Hibernate enhances Foo producing a class is called Foo_
> $$_javassist_45. However, the RequestFactory cannot associate the
> enhanced class with FooProxy.
>
> Is there a way around it ?
>
> Thanks
> Stefan
--
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-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment