我终于解决了这个问题,在编辑了答案中显示的所有内容之后,我将Country.hbm.xml文件修改为:(注意注释行)
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" ><hibernate-mapping> <!-- <class name="Country" table="country"> --> <class name="org.hibernate.tutorial.hbm.Country" table="country"> <id name="id_country"/> <property name="country"/> </class></hibernate-mapping>
它必须是
org.hibernate.tutorial.hbm.Country,不是
org.hibernate.tutorial.hbm.country


![org.hibernate.hql.internal.ast.QuerySyntaxException:[未从表映射]表 org.hibernate.hql.internal.ast.QuerySyntaxException:[未从表映射]表](http://www.mshxw.com/aiimages/31/399421.png)
