I think you're looking for a many-to-one, not a one-to-one. One-to-one's are typically between two identical primary keys, if you're using foreign keys then it's more likely that you've got a many-to-one relationship. See: I think you mean a many-to-one sir<http://blog.jagregory.com/2009/01/27/i-think-you-mean-a-many-to-one-sir/>
On Fri, Mar 6, 2009 at 12:44 PM, Kris-I <[email protected]> wrote: > > Hello, > > I have 2 tables Order and ORderDetails when I save the Order the > OrderDetails are save too. That's work fine. > > Now, I'm adding the VAT table and create a foreign key between VAt > table and Order, it's a one-one relation. > > When I execute my test, in the query, I don't see the field VAT in the > INSERT SQL statement. > > I suppose it's a mapping file trouble. > > The Order : > <one-to-one name="VAT" class="MyAssembly.VAT,MyAssembly" /> > > the VAT.hbm.xml : > <one-to-one name="Order" class="MyAssembly.MyAssembly" constrained="true"/> > > > In the class > > Order.hbm.xml > public class Order > { > ..... > > public virtual VAT VAT { get; set; } > ... > } > > VAT > public class VAT > { > .... > > public virtual Order Order { get; set; } > } > > > I forgoet something ? > > thanks, > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
