I am new to NHibernate, and have a couple questions that that I am curious as to how you would recommend best be handled with NHibernate. I have searched for the answers to these questions and found various ways to handle them, so I am curious as to what is the recommended way so I get going on the right foot.
The first is how to deal with a bunch of lookup tables. So if I have 3 tables: Customer CustomerType StatusType Let's assume that anytime I want to pull Customer, I will also want to pull the customer type and status type. So, in SQL, I would have something like: select * (ok, I wouldn't really use the *) from customer inner join customertype ... inner join statustype ... Would the best way to do this is always do an eager load on customertype and statustype objects, or can I create a mapping file that would have the info from the 3 tables, or is there an even better way? Secondly, if I have the following tables (which in this case I do): Instrument (common fields across all instruments) Instrument Type (i.e. Stocks, bonds, options, etc) StockDetail (linked to Instrument by InstrumentID) BondDetail (linked to Instrument by InstrumentID) OptionDetail (etc) So let's say I want to pull up one stock. Would I want a mapping for Instrument and another for StockDetail, and then if I search for all stocks, would I pull all stocks and do an eager load (inner join) on instrument? Or would I want to create one mapping/object for Stocks that has the 2 tables, one object/mapping for Bonds, etc? -- 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.
