The contents of this section
Introduced
Type of collection in NHibernate
Establish a parent-child relationship
Parent-Child Association mappings
Conclusion
Introduced
Through the introduction of several previous articles, basically understand the nhibernate, but in the nhibernate mapping relationship is the highlight of NHibernate, but also the most difficult to master technology. From this beginning to learn these things, I will combine graphics and text to illustrate the secret knowledge here.
In the previous few, our example uses only a simple customer object. But in the customer/order/Product classic portfolio, their relationship is very complex? Let's review the data model created in the second article.
On the diagram, I have clearly labeled the relationship between the tables, first analyzing the "foreign key relationship" between customer and order, or "parent-child relationship", "One-to-many relationship". First understand the collection in NHibernate before analyzing.