1、xxx is not a mapping 映射关系失败,解决:将hql语句“from table”改为
“from 实体类名”即可解决。
2、Unknow entity:com.bean.Student:没有在hibernate.cfg.xml中添加<mapping resource="*.hbm.xml">
3、No dataBase for selected:在hibernate.cfg.xml的url连接后面添加数据库名即可
4、could not extract ResultSet:配置方言出错,mysql5.0以上用org.hibernate.dialect.MySQL5Dialect,
mysql5.0以下用org.hibernate.dialect.MySQLDialect
本文针对Hibernate框架使用过程中遇到的四个典型错误进行了解析,并提供了具体的解决方案。包括:映射关系失败、未知实体、未选择数据库及无法提取结果集等问题。
2万+

被折叠的 条评论
为什么被折叠?



