I have an object hierarchy that is as follows.
Party inherited by Organization and Person
Organization inherited by Customer, Vendor
Person inherited by Contact
In the database I have the following tables
Party, Customer, Vendor, Contact. All of them have a corresponding row in Party table.
Contact belongs to either Vendor or Customer. I have a field on the Contact table for org_party_id. However, since the organization can be either a Customer or Vendor I need to be able to look at different tables.
Is there a way to map this in hibernate? Or, a better way to manage it in DB/ hibernate?