【发布时间】:2011-01-06 11:23:07
【问题描述】:
有没有办法用Annotation替换constructor-arg?
我有这个构造函数:
public GenericDAOImpl(Class<T> type) {
this.type = type;
}
我需要在我的 Facade 中注入它:
@Inject
private GenericDAO<Auto, Long> autoDao;
问题是我不知道如何在 costructor 中传递参数的值。
提前谢谢你
[更多信息] 我试图解释我的问题。
<bean id="personDao" class="genericdao.impl.GenericDaoHibernateImpl">
<constructor-arg>
<value>genericdaotest.domain.Person</value>
</constructor-arg>
</bean>
我想只使用注释来转换该代码。 有人可以解释一下吗?
【问题讨论】:
标签: java spring generics annotations code-injection