SSH 找不到映射,麻烦给为高手帮我看看,我找了一天多没找到答案。在线等
错误:org.hibernate.hql.ast.QuerySyntaxException:MessageGroupingisnotmapped[fromMessageG...
错误:org.hibernate.hql.ast.QuerySyntaxException: MessageGrouping is not mapped [from MessageGrouping]
*hbm.xml:
<hibernate-mapping>
<class name="smart.jrsoft.wizoa.form.addgroup.MessageGrouping" table="MESSAGE_GROUPING" schema="WIZOA">
<id name="autoId" type="long">
<column name="AUTO_ID" precision="10" scale="0" />
<generator class="increment" />
</id>
<property name="groupingname" type="string">
<column name="GROUPINGNAME" length="20" />
</property>
<property name="flag" type="long">
<column name="FLAG" precision="10" scale="0" />
</property>
</class>
</hibernate-mapping>
Spring:
<property name="mappingResources">
<list>
<value>
smart/jrsoft/wizoa/form/address/Address.hbm.xml
</value>
<value>
smart/jrsoft/wizoa/form/addgroup/MessageGrouping.hbm.xml
</value>
</list>
</property>
</bean>
<bean id="addressDao" class="smart.jrsoft.wizoa.dao.address.AddressDao"
abstract="false" lazy-init="default" autowire="default">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<!-- 配置action -->
<bean name="/addressDo" class="smart.jrsoft.wizoa.action.address.AddressAction"
abstract="false" lazy-init="default" autowire="default">
<property name="addressDao">
<ref bean="addressDao" />
</property>
</bean>
dao类 public List<MessageGrouping> findGroup() {
return this.getHibernateTemplate().find("from MessageGrouping");
} 展开
*hbm.xml:
<hibernate-mapping>
<class name="smart.jrsoft.wizoa.form.addgroup.MessageGrouping" table="MESSAGE_GROUPING" schema="WIZOA">
<id name="autoId" type="long">
<column name="AUTO_ID" precision="10" scale="0" />
<generator class="increment" />
</id>
<property name="groupingname" type="string">
<column name="GROUPINGNAME" length="20" />
</property>
<property name="flag" type="long">
<column name="FLAG" precision="10" scale="0" />
</property>
</class>
</hibernate-mapping>
Spring:
<property name="mappingResources">
<list>
<value>
smart/jrsoft/wizoa/form/address/Address.hbm.xml
</value>
<value>
smart/jrsoft/wizoa/form/addgroup/MessageGrouping.hbm.xml
</value>
</list>
</property>
</bean>
<bean id="addressDao" class="smart.jrsoft.wizoa.dao.address.AddressDao"
abstract="false" lazy-init="default" autowire="default">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<!-- 配置action -->
<bean name="/addressDo" class="smart.jrsoft.wizoa.action.address.AddressAction"
abstract="false" lazy-init="default" autowire="default">
<property name="addressDao">
<ref bean="addressDao" />
</property>
</bean>
dao类 public List<MessageGrouping> findGroup() {
return this.getHibernateTemplate().find("from MessageGrouping");
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询