2012/2/2 James Farrell <jamespfarr...@gmail.com>: > I have inherited a legacy database that doesn't have foreign keys on these 2 > tables, and therefore not surprisingly, no join table. > > If I'm not misataken creating a join table now is impossible since I can't > create a foreign key on either of these tables, because both table have many > records per BookingIds. Or am I wrong somehow? > > BookingsTable > > > ID - primarykey > > > BookingId (this is what I need to join on) > > > > BookingLocationsTable > > > ID - primaryKey > > > BookingId (this is how I would join) > >
It seems confused. BookingTable "sounds like" the main concept, but this non-unique BookingId contradicts that. It seems almost like you are missing the concept "Booking", where the values of BookingId would exist once, as primary key. The other two tables would be one-to-many with respect to that table. Forgetting about the details in the tables for a minute, what concepts do you actually have and how are they related? /Oskar -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.