问题:org.springframework.orm.hibernate3.HibernateQueryException: User is not mapped [from User as model
where model.UName= ?]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: User is not mapped
[from User as model where model.UName= ?]
解决方法:在 applicationContext.xml 中添加 XX.hbm.xml ,例如:
<property name="mappingResources">
<list>
<value>cn/edu/pojo/Goodperson.hbm.xml</value>
<value>cn/edu/pojo/Team.hbm.xml</value>
<value>cn/edu/pojo/Projecttable.hbm.xml</value>
<value>cn/edu/pojo/Datadictionary.hbm.xml</value>
<value>cn/edu/pojo/User.hbm.xml</value>
</list>
</property>
<list>
<value>cn/edu/pojo/Goodperson.hbm.xml</value>
<value>cn/edu/pojo/Team.hbm.xml</value>
<value>cn/edu/pojo/Projecttable.hbm.xml</value>
<value>cn/edu/pojo/Datadictionary.hbm.xml</value>
<value>cn/edu/pojo/User.hbm.xml</value>
</list>
</property>