<class name="admin.model.OrganizationUnit" table="ORGANIZATION_UNIT" discriminator-value="admin.model.OrganizationUnit" dynamic-update="true">
<id name="ObjectId" type="string" column="object_id">
<generator class="assigned"/>
</id>
<discriminator column="discriminator"/>
<property name="ObjectType" type="string">
<column name="ObjectType" sql-type="varchar2(255)" not-null="true"/>
</property>
<subclass name="admin.model.DmSystem" discriminator-value="admin.model.DmSystem" dynamic-update="true">
<set name="ChildOrgs" lazy="true" table="ORGANIZATION_UNIT" where="ou_type_code='CWORG'">
<key column="system_org_id"/>
<one-to-many class="Dm.bizcomponent.admin.model.OrganizationUnit"/>
</set>
<set name="SystemAdminAccessGroup" lazy="true" inverse="true" table="CWGROUP" where="group_type_code='SYSTEM_ADMINACCESS'">
<key column="owner_id"/>
<one-to-many class="admin.model.Group"/>
</set>
</subclass>
</class>
这是映射代码 在上面的代码中,有一个父类OrganizationUnit,带有两个子类