简体   繁体   English

春季3 MVC验证与Hibernate,hasErrors后错误?

[英]Spring 3 MVC Validation with Hibernate, error after hasErrors?

I am just learning Spring3 Validation with Hibernate. 我只是在学习Hibernate的Spring3验证。 I have this class but I am setting getting the following error 我有这个课程,但是我正在设置以下错误

org.hibernate.MappingException: Unknown entity: com.stutteringjohnsmith.model.Friend org.hibernate.MappingException:未知实体:com.stutteringjohnsmith.model.Friend

I am doing the sample from 我做从样本

http://www.roseindia.net/tutorial/spring/spring3/web/spring-3-mvc-and-hibernate3-example-part1.html http://www.roseindia.net/tutorial/spring/spring3/web/spring-3-mvc-and-hibernate3-example-part1.html

but I change the Article to Friend! 但我将文章更改为朋友! Please help me out 请帮帮我

The most likely problem is that there is still a reference to the "Article" in the code that has not been updated to "Friend". 最有可能的问题是,仍然有在代码中的“条”尚未更新为“朋友”的参考。 I would try searching all the files for "Article" and update as required. 我会尝试在所有文件中搜索“文章”,并根据需要进行更新。 Have you changed the <property name="annotatedClasses"> section in the dispatcher-servlet.xml file for example? 你已经改变了<property name="annotatedClasses">部分中的dispatcher-servlet.xml的示例文件?

Also you might want accept answers to your questions otherwise it might put people off helping you out! 您可能还需要接受回答您的问题,否则它可能把人关帮助你摆脱困境!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM