The content of element type "hibernate-mapping" must match "(meta*,typedef*,import*,(class|subclass|

The content of element type "hibernate-mapping" must match "(meta*,typedef*,import*,(class|subclass|

 joined-subclass|union-subclass)*,resultset*,(query|sql-query)*,filter-def*,database-object*)".


fuck  hbm.xml中的配置信息一定要写正确喽!!!各种属性必须放在<class></class>中


我错误的代码

<class name="org.model.Student" table="student" catalog="hibernate">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="native" />
</id>
<property name="snum" type="java.lang.String">
<column name="snum" length="45" />
</property>
<property name="sname" type="java.lang.String">
<column name="sname" length="45" />
</property>
<property name="sage" type="java.lang.Integer">
<column name="sage" />
</property>

</class>
<set name="courses" table="stu_cour" lazy="true" cascade="all">
<key column="sid"></key>
<many-to-many class="org.model.Coures" column="cid"></many-to-many>
</set>


set写到外面去了

你可能感兴趣的:(The content of element type "hibernate-mapping" must match "(meta*,typedef*,import*,(class|subclass|)