Hi everyone,
I actually try to do a Celltable-Component, that can work with any
Proxy-class. So the component should work with a template class T.
(Actually it just works with a certain type of Proxy)
Inside the component, i actually got some Requests for the certain Proxy,
like delete(), persist(), findall(). These requests I want to make work
with all kinds of proxies.
Now, instead of writing:
CertainEntityRequest request = Factory.certainEntityRequest ();
Request<List<CertainEntityProxy>> findAll= request.findall(
offset, size, orderByString);
I want to have a BaseRequest, that has these services for all my proxies.
I tried to put all service-methods that I use in my component into one
base-Service, similar to this post
http://stackoverflow.com/questions/7625692/gwt-2-4-0-requestfactory-polymorphism.
persist() and remove() works well. But I dont know how to implement the
findall() / getDataPage() service.
@Entity class EntityBase {
//some methods, persist(), remove() etc
...
public List<EntityBase> getDataPage(int offset, int limit,
String orderString) {...}
}@Entity class SomeEntity extends EntityBase {...}
@Entity class SomeOtherEntity extends EntityBase
{...}...@ProxyFor(EntityBase.class) class EntityBaseProxy extends EntityProxy
{...}@ProxyFor(SomeEntity.class) class SomeEntity extends EntityBaseProxy {...}
@ProxyFor(SomeOtherEntity.class) class SomeEntity extends EntityBaseProxy {...}
...
@Service(value = EntityBase.class, locator = MyServiceLocator.class)
@ExtraTypes({ SomeEntity.class, SomeOtherEntity.class })
public interface EntityBaseRequest extends RequestContext {
InstanceRequest<EntityBaseProxy, Void> remove();
InstanceRequest<EntityBaseProxy, Long> persist();
//This doesnt work. And even if this would work, how to build the query ? I
wouldnt know the specific class, it could be SomeEntity or SomeOtherEntity....
//Thats the error: *Could not find domain method similar to
java.util.List<...EntityBaseProxy> getDataPage(intintjava.lang.String)*
*Request<List<EntityBaseProxy>> getDataPage(int offset, int limit, String
orderString)*
}
I also found this issue, I guess thats what I try to do:
http://code.google.com/p/google-web-toolkit/issues/detail?id=6234
Anyways, Im not sure if I even chose the right approach. Maybe there is
already an working example for this ? Or a simpler approch?
Regards,
Manuel
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.