Hi,

Is there any way to inject dynamic values to a class according to the
annotation parameters with Guice?
Eg.: I have the following fields in a class:

@PersistenceContext(unitName="Test1PU")
EntityManager em1;

@PersistenceContext(unitName="Test2PU")
EntityManager em2;

An I would like to inject different EntityManager instances.
Unfortunately I can't access the annotation or the original Field over
the the Provider interface:

binder.bind(EntityManager.class).annotatedWith(PersistenceContext.class).toProvider(new
EntityManagerProvider(directory, ???unitName value???));

Is there any solution for it?

Thanks:
m.
--~--~---------~--~----~------------~-------~--~----~
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