用Hibernate3注解映射出现的异常,以下是异常消息:(from Part : 我写的HQL语句,Part 为类名),为什么为不能映射呢,启动时是没错的。请高手看看,谢谢了......2010-3-27 22:59:14 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
org.hibernate.hql.ast.QuerySyntaxException: Part is not mapped [from Part]框架:Struts2.0+Hibernate3.2+Spring2.5
严重: Servlet.service() for servlet default threw exception
org.hibernate.hql.ast.QuerySyntaxException: Part is not mapped [from Part]框架:Struts2.0+Hibernate3.2+Spring2.5
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
<property name="packagesToScan">
<list>
<value>com.accp.entity</value>
</list>
</property>
</bean>
你的名字是否映射失败什么的要不把你的映射文件贴出来SEESEE
正解。 hibernate里面的的表名对应的是你实体类名也就是hbm。xml里面定义的类名而不是表名和其完全一致就可以了。