On Fri, Oct 3, 2008 at 2:11 AM, Rahul <[EMAIL PROTECTED]> wrote:

>  private <T extends CommonUpdatableEntity> Store<T, Query<T>>
> getStoreInstance(Class<T> entity) {


You need to pass in TypeLiteral<T> instead of Class<T> here.


>    List<Binding<Store<T, Query<T>>>> bindings =
> injector.findBindingsByType(new TypeLiteral<Store<T, Query<T>>>() {
>    });


Due to erasure, this is actually looking for Store<T, Query<T>>, not
Store<Project, Query<Project>>.

If you still want to pass in Class<T>, you could implement ParameterizedType
yourself in this method. getRawType() would return Store.class.
getActualTypeArguments() would return Project.class and a second
ParameterizedType impl to represent Query<Project>.

Bob

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" 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-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to