I hav three table, a role table, an action table and a composition permission table which contain roleId and actionId.
The code for RolePos.hbm.xml is
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="system.RolePos" table="role">
<id name="roleId" type="int" column="roleId" unsaved-value="0">
<generator class="increment"/>
</id>
<property name="roleName">
<column name="roleName"/>
</property>
<set name="properties" lazy="true" inverse="true" cascade="all-delete-orphan">
<key column="roleId" />
<one-to-many class="system.PermissionPos" />
</set>
</class>
</hibernate-mapping>
The code for ActionPos.hbm.xml is
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="system.ActionPos" table="action">
<id name="actionId" type="int" column="actionId" unsaved-value="0">
<generator class="increment"/>
</id>
<property name="actionName">
<column name="actionName"/>
</property>
<set name="properties" lazy="true" inverse="true" cascade="all-delete-orphan">
<key column="actionId" />
<one-to-many class="system.PermissionPos" />
</set>
</class>
</hibernate-mapping>
The code for PermissionPos.hbm.xml is
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="system.PermissionPos" table="permission">
<id name="roleId" type="int" column="roleId" unsaved-value="0">
<generator class="assigned"/>
</id>
<id name="actionId" type="int" column="actionId" unsaved-value="0">
<generator class="assigned"/>
</id>
<many-to-one name="roleId" class="system.RolePos" column="roleId"/>
<many-to-one name="actionId" class="system.ActionPos" column="actionId"/>
</class>
</hibernate-mapping>
After run the program, it shows Could not parse mapping document from resource PermissionPos.hbm.xml and Could not parse mapping document from resource PermissionPos.hbm.xml. Can anybody help me? Thanks a lot.
|