以下錯誤是在我的月食上看到的。我只是想保存一個terminalgroup對象,並得到一個關於TerminalGroupImpl找不到的錯誤。所以我創建了一個TerminalGroupImpl.java作爲hibernate文件,該文件的終端組表爲@Entity。我有一個TerminalGroupDaoHibernate.java文件,它使用TerminalGroupImpl.class在terminal_group表上執行查詢。春季和休眠運行時錯誤
如果有人能告訴我我的代碼有什麼問題和/或我能做些什麼來弄清楚什麼是錯的?
錯誤
Invalid property 'terminalGroupDaoHibernate' of bean class
[com.ccadllc.dac.model.consumer.terminalgroups.TerminalGroupServiceImpl]:
Bean property 'terminalGroupDaoHibernate' is not writable or has an invalid setter method.
Does the parameter type of the setter match the return type of the getter?
這裏是我的applicationContext.xml文件:
<!-- Terminal Group Service -->
<bean id="com.ccadllc.dac.model.consumer.terminalgroups.TerminalGroupService"
class="com.ccadllc.dac.model.consumer.terminalgroups.TerminalGroupServiceImpl">
<property name="terminalGroupDao"
ref="com.ccadllc.dac.model.consumer.terminalgroups.dao.TerminalGroupDao"/>
<property name="terminalGroupComponentDao"
ref="com.ccadllc.dac.model.consumer.terminalgroups.dao.TerminalGroupComponentDao"/>
</bean>
<bean id="com.ccadllc.dac.model.consumer.terminalgroups.TerminalGroupImpl"
class="com.ccadllc.dac.model.consumer.terminalgroups.TerminalGroupImpl" abstract="true">
<property name="terminalGroupDaoHibernate"
ref="com.ccadllc.dac.model.consumer.terminalgroups.dao.TerminalGroupDaoHibernate"/>
</bean>
<bean id="com.ccadllc.dac.model.consumer.terminalgroups.dao.TerminalGroupDao"
class="com.ccadllc.dac.model.consumer.terminalgroups.dao.TerminalGroupDaoHibernate">
<property name="messageService" ref="com.ccadllc.dac.messaging.MessagingService" />
</bean>
under hibernate.annotated.classes:
<value>com.ccadllc.dac.model.consumer.terminalgroups.TerminalGroupImpl</value>
TerminalGroupServiceImpl.java
Getter/Setter in TerminalGroupServiceImpl.java:
private TerminalGroupDao terminalGroupHibernateDao;
/**
* @param TerminalGroupHibernateDao The TerminalGroupHibernateDao to set.
*/
@Required
@Transactional
public void setTerminalGroupHibernateDao(final TerminalGroupDao terminalGroupHibernateDao)
{
this.terminalGroupHibernateDao = terminalGroupHibernateDao;
}
@Required
@Transactional
public TerminalGroupDao getTerminalGroupHibernateDao()
{
return terminalGroupHibernateDao;
}