@Named("myUniqueName")
public class ReportDashboardDao implements DashboardDAO{
//STUFF
}
how can i access the string inside @Named tag when i am injecting DashboardDAO like this :
@Named
public class DshboardDaoConsumer(){
@Inject List<DashboardDAO> dashboardDAO;
//STUFF
}
Use a Map instead
@Inject
Map<String, DashboardDao> dashBoardDaos;
This will inject a Map
with bean names as keys and daos as values.
Of course, you could also read the annotation value from class instances.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With