I have 3 classes : Resource, Role and Permission
Resource: id, date
Role: name
Permission: id, role, permission
Role is a subclass of Resource.
Permission contains Resource and Role.
I have a problem with my mapping file. Could you help me? I don't know
how to represent that.
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="Permission" table="DWPermission">
<id name="id" column="id" type="long">
<generator class="native"/>
</id>
<component name="role" class="Role">
<property name="idRole" type="long"/>
</component>
<component name="ressource" class="Resources">
<property name="idResource" type="long"/>
</component>
</class>
<class name="Resources" table="DWResources">
<id name="id" column="id" type="long">
<generator class="native"/>
</id>
<property name="date" type="timestamp"/>
<joined-subclass name="Role" table="DWRole">
<key column="resourceId"/>
<property name="name" type="string" unique="true"/>
</joined-subclass>
</class>
</hibernate-mapping>
Thanks
|