The discriminator column is the one that determines which subclass is appropriate for the entity. e.g.
Code:
Table Party(number primaryKey, varchar partyType, number foreignKey)
Table Person(number personKey, varchar personName)
Table Company(number companyKey, varchar companyName)
So, the Party table's foreign key can either refer to the primary key of the Person table or the primary key of the Company table, depending on (i.e. discriminated by) the value of the partyType string. If partyType='PERSON', then the foreignKey field maps a one-to-one relationship to the Person table. Likewise, if the partyType='COMPANY', then the foreignKey field maps a one-to-one relationship to the Company Table. Mappings would look like this:
<hibernate-mapping>
<class name="eg.Party" table="Party">
<id name="id" column="primaryKey"/>
<discriminator column="partyType" type="string"/>
<subclass name="eg.PartyForPerson" discriminator-value="PERSON">
<many-to-one name="person" class="eg.Person">
<column name="foreignKey"/>
</many-to-one>
</subclass>
<subclass name="eg.PartyForCompany" discriminator-value="COMPANY">
<many-to-one name="company" class="eg.Company">
<column name="foreignKey"/>
</many-to-one>
</subclass>
</class>
</hibernate-mapping>
Not shown: mappings for Person,Company