org.hibernate.Invalid總報這個 MappingException: Could not parse mapping document from resource Student.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 2016-7-11 11:54:54 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
? ? <class name="Student" table="STUDENT">
? ? ? ? <id name="sid" type="int">
? ? ? ? ? ? <column name="SID" />
? ? ? ? ? ? <!--sid的屬性初始值為0 -->
? ? ? ? ? ? <!-- <generator class="assigned" /> -->
? ? ? ? ? ? <!-- ?sid的屬性值從1開始自動遞增-->
? ? ? ? ? ?<generator class="native"></generator>
? ? ? ? </id>
? ? ? ? <property name="sname" type="java.lang.String">
? ? ? ? ? ? <column name="SNAME" />
? ? ? ? </property>
? ? ? ? <property name="gender" type="java.lang.String">
? ? ? ? ? ? <column name="GENDER" />
? ? ? ? </property>
? ? ? ? <property name="birthday" type="java.util.Date">
? ? ? ? ? ? <column name="BIRTHDAY" />
? ? ? ? </property>
? ? ? ? <property name="picture" type="java.sql.Blob">
? ? ? ? ? ? <column name="PICTURE" />
? ? ? ? </property>
<!-- ? ? ? ? <property name="address" type="java.lang.String">
? ? ? ? ? ? <column name="ADDRESS" />
? ? ? ? </property> -->
? ? ? ? <component name="address" ?class="Address">
? ? ? ? ? ? ? <property name="aid" column="AID"></property>
? ? ? ? ? ? ? <property name="postcode" column="POSTCODE"></property>
? ? ? ? ? ? ? <property name="phone" column="PHONE"></property>
? ? ? ? ? ? ? <property name="address" column="ADDRESS"></property>
? ? ? ? </component>
? ? </class>
</hibernate-mapping>
2016-10-04
<class name="Student" table="STUDENT"> 還不行這個也加上包名
2016-10-04
?<component name="address" ?class="Address">這個?class="包.Address"要加上包名,應(yīng)該就可以了
2016-07-31
我的是創(chuàng)建Address類時,忘記添加getter()和setter()方法了
2016-07-27
你的問題解決沒,我也是這個問題
2016-07-12
開始的環(huán)境被配置好吧,你再看看一開始的那些配置怎么配置配置一下
再不行我就不知道了