Yes, you don't need to map a relationship - you can do ad-hoc joins in HQL. And, you can also use SQL through NHibernate for difficult queries if needed.
/Oskar 2012/2/2 James Farrell <jamespfarr...@gmail.com>: > Yes the DB is a big horrible mess. > > I thinking it's dawning on me that there really is no relationship between > these 2 tables. > > I just want to do the equivalent of a join between these 2 tables. > > This is my first time using an ORM like this, so I assumed that the only way > I could do this is to establish some sort of relationship between them, but > now I'm realising that perhaps I can do this using HQL? > > James > > On 2 February 2012 11:06, Oskar Berggren <oskar.bergg...@gmail.com> wrote: >> >> 2012/2/2 Oskar Berggren <oskar.bergg...@gmail.com>: >> > 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? >> >> >> >> A join table would target the primary key in each of the existing >> tables and has nothing to do with the BookingId. You would need the >> contents of BookingId to construct the new join table for existing >> data, but after that the BookingId would be obsolete. Unless you need >> it for something else. >> >> /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. >> > > > > -- > James Farrell > Web Developer > +49 1 57 36 37 06 66 | i...@jamespfarrell.com | http://www.jamespfarrell.com > Twitter: http://twitter.com/positonic | LinkedIn: > http://www.linkedin.com/in/jamespfarrell > > -- > 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. -- 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.