Create a new table called Organization with 2 fields org_party_id and org_party_type.
each org_party_id whould match match a Customer.id if the org_party_type is CUSTOMER, or a Vendor.id if the org_party_type is VENDOR.
Change the mappings of Customer and Vendor to be a Subclasses of Organization. (See the reference manual . Set org_party_type as the discriminator.
Now, set the mapping of Contact to point to Organization.
This will abstract out the organization part of Customers and Vendors, so that you can deal with them consistently. You might want to create an Organization interface in your code as well so the abstraction is consistent.
UPDATED
Based on your comments, (and be rereading the question), it looks like a joined-subquery is your best bet. This would mean that you don't really need to add org_party_type, as the subclasses are joined by the ID. Like so:
<class name="Party" table="PARTY">
<id name="org_party_id" column="uid" type="long">
<generator class="hilo"/>
</id>
<!-- other PARTY properties -->
<joined-subclass name="Customer" table="CUSTOMER">
<key column="customer_id"/>
<property name="name" type="string"/>
<!-- other CUSTOMER properties -->
</joined-subclass>
<joined-subclass name="Vendor" table="VENDOR">
<key column="vendor_id"/>
<property name="name" type="string"/>
<!-- other VENDOR properties -->
</joined-subclass>
</class>
_