Do you really need the association to be bidirectional (because its not a NH requirement)? If not, the solution is quite simple: don't let the Address table hold the foreign key to your Order, Customer tables, instead have each Customer, Company, Person, Order have a foregin key to your Address table.
The things become really complex if you need a bidirectional association: you will derive all your Company, Order, Person objects from a base class , let say ObjectWithAddress which defines the Address property. This case is covered in the Hibernate documentation when it discusses implicit polymorphism "8.1. The Three Strategies". Check the table per concrete subclass strategy.
Cheers,
Radu
|