Crossposted on StackOverflow.

http://stackoverflow.com/questions/11207729/problems-with-class-hierarchy-on-guice-object

Em terça-feira, 26 de junho de 2012 09h53min51s UTC-3, André Salvati 
escreveu:
>
> I'm trying to use Guice to instantiate my Objectify DAOs. My hierarchy is 
> the following:
>
> public class EmpresaDao extends ObjectifyDao<Empresa> { ... }
>
> public class ObjectifyDao<T> extends DAOBase { ... }
>
> When I use "new EmpresaDao()", getClass().getGenericSuperclass() gives me:
>
>     [INFO] superclass -> 
> br.com.xxxxx.server.service.ObjectifyDao<br.com.xxxxx.domain.Empresa>
>
> When I use "injector.getInstance(EmpresaDao.class)", 
> getClass().getGenericSuperclass() gives me:
>
>     [INFO] superclass -> class br.com.xxxx.server.service.EmpresaDao
>
> Obviously, I want to let Guice instantiate my objects with DI.
>
> Can someone explain why this is happen?
>
> Is there any way (instantiating with Guice) to get the same superclass as 
> with new().
>
> Thanks.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-guice/-/mnEh8uRWpHEJ.
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