我终于解决了这个问题,在编辑了答案中显示的所有内容之后,我将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
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)