try a Google query for "partial foreign key" and you will see that what you want to do is not a valid relationship. Are you able to declare a foreign key in your database in this manner? If the database does not allow why do you think NHibernate would support it?
John Davidson On Fri, Oct 15, 2010 at 8:48 AM, IsNull <[email protected]> wrote: > Hello, > > First, I actually want use fluent hibernate, but I'm not sure if it > possible with it. Actually I even not sure if it possible with > nHibernate: > > I've the following table scheme: > > Machines ( > PK Mandator smallint > PK MachineID smallint > > Typ varchar > Text varchar > ) > > MachineTypes ( > PK Mandator smallint > PK Art varchar > > Name varchar > ) > > > Every table has a composite PK containing the field "Mandator". The > Column Machines.Typ is a foregin key to the MachineTypes table. > They should be joined as: > Machines.Mandator == MachineTypes.Mandator > Machines.Typ == MachineTypes. Art > > > Is this possible with nHibernate? If so I would appreciate a little > example mapping of this given data. > > Here is the thread in fluent nHibernate forum: > > http://support.fluentnhibernate.org/discussions/help/340-multiple-composite-primary-keys > But until now I didn't had any success with it. > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
