| In fact you are missing something, but just a little bit We have that same problem and it's not a ManyToOne relationship, it's OneToOne. Imagine this scenario: List of Reservations <-> Person (person in charge of reservations for one or more companies.) ManyToOne Reservation -> Company OneToOne Scenario: Our person, the Manager (which is a role in our system) is in charge of handling reservations for a number of different companies. So there's a OneToMany relationship to those, so there's a reference id on the company object. Now this Manager creates a reservation and since the Manager is in charge of many different companies, the reservation object needs the information who the reservation is for. Meaning, there needs to be a reference column for the company on the reservations table. This is OneToOne and not ManyToOne. ONE reservation to ONE company. It is also NOT optional, because without that information the reservation is ot for anybody. There must not be a unique key constraint. How do we fix this? Or am I missing something and is it actually a ManyToOne relationship that I do not get?  |