Hi Regarding
1) NH is a PI framework, it will achieve it goals letting you to do same things as you will do in the language without persistence. There is no magic in C# or Java that will give you a way to set only one side of the collection and the other one will magically appear. 2) I don't see what the worry about with the cascade action is you must write it in the mapping if you need it and you may not write it if you don't...the same applies for opening a FK in a DB 3) The problem is not extra SQL the problem is which side is in charge of the persistence. 4) You are using an advanced ORM because you want things like lazy loading, you don't need to worry about them you can set default = false and live in the old days without lazy loading...you use it because you know you need it, it's not NH which will force you to use it and it won't decide to you what's lazy or what not like SQL does not decide if you bring a joing between two databases with a join or a select and a after that running with a CURSOR... 5) many-to-many relations sometimes are really cruel...i try to avoid them if i can. Regarding the conclusion, you talked about thinks you consider problematic mapping collections and then ask if NH only advantage is only on querying, i don't think mapping a collection is even 0.01% of what the framework brings... Gustavo. On Sat, Sep 20, 2008 at 2:08 PM, ndotan <[EMAIL PROTECTED]> wrote: > > Hey all, > I have a theoretical question.i fail to see how nhibernate makes life > easy for me by mapping relations. > > Every way i look at it, it seems that it poses more work to the > programmer. > for example taking directly from the documentation: > > http://www.hibernate.org/hib_docs/nhibernate/html/example-parentchild.html > > Parent p = (Parent) session.Load(typeof(Parent), pid); > Child c = new Child(); > c.Parent = p; > p.Children.Add(c); > session.Save(c); > > 1. I need to maintain both edges of the link myself, > 2. i need to worry about cascade action > 3. i need to worry about the extra sql that is generated if i do not > use inverse=true > 4. i need to worry about when to use lazy loading. > 5. in many to many relations, i need to worry twice as much. > > so is the only advantage in the querying? and if so, i imagine that > most of the queries would be done in HQL and i could just do a join > for the relations by hand. > > > i feel im missing a point. > > 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 -~----------~----~----~----~------~----~------~--~---
