Hi All,
I'm having trouble creating a model for a couple entities that is sane in both Hibernate and the Database. Any help is appreciated.
A company entity and table exists, which provides both a company name and a "company code". The company code must be unique.
Company's may act as 2 different entities, clients or partners.
We'd like to have separate Client and Partner Entities.
The complicating factors I see are
1) Companies can be both a client and a partner.
2) The company code must remain unique.
3) We want to be able to create new clients and partners passing company_code's as a parameter. eg. new Client("WALMART") and new Partner("WALMART") that should map to the same company.
Single-Table and Multi-Table Inheritance don't work because they don't map a Merchant and Client with the same company code to a single company.
Thanks all.