Attack it from another angle, try something crazy, be creative! Only your mind is setting the limits of what you can do. I also recommend you read the NHibernate reference. Learning how to map something with xml should teach you how to map it fluently!!
- Html <http://nhforge.org/doc/nh/en/index.html> - Pdf<http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/pdf/nhibernate_reference.pdf> - Wiki <http://knol.google.com/k/fabio-maulo/-/1nr4enxv3dpeq/21#view> On Fri, Aug 14, 2009 at 10:32 AM, Topflysecurity <[email protected]>wrote: > > please show me how i should map this two and how the domain classes > should look like. Customer and CustomerConfiguration.. would > appriciate that alot cause im stuck now. > > On 14 Aug, 10:26, James Gregory <[email protected]> wrote: > > No, that's a one-to-many. A many-to-one is just a single property. > > On Fri, Aug 14, 2009 at 9:23 AM, Topflysecurity <[email protected] > >wrote: > > > > > > > > > one more question tho. with a many to one my my customer will have a > > > ilist<CustomerConfiguration> and thats what i thought i would not have > > > to do with one-to-one. so i have to get the id of the > > > CustomerConfiguration to update it. > > > alteast the way i do it, am i right? > > > > > On 14 Aug, 09:59, James Gregory <[email protected]> wrote: > > > > Generally you want a many-to-one, it's rare to need a one-to-one. > > > > A many-to-one is where the child of the relationship > > > (CustomerConfiguration) > > > > has a foreign-key column that references the parent; so > > > > CustomerConfiguration would have a CustomerId column in it's table. > > > > > > A one-to-one is joined on the primary key of the two tables, so there > is > > > no > > > > explicit foreign-key, it's just that the two rows in the two tables > share > > > a > > > > PK value. > > > > > > On Fri, Aug 14, 2009 at 8:52 AM, Topflysecurity < > [email protected] > > > >wrote: > > > > > > > i found a great example of one-to-one so im coding it now. but im > > > > > confused now with that post you wrote about the many to one. > > > > > my Customer should only be able to have one CustomerConfigruation. > one- > > > > > to-one or many-to-one, what you think? am i missing something? > > > > > > > On 14 Aug, 09:34, James Gregory <[email protected]> wrote: > > > > > > HasOne(x => x.CustomerConfiguration)? > > > > > > Are you sure you want a one-to-one and not a > many-to-one/References? > > > See > > > > > > here< > > > > > > http://blog.jagregory.com/2009/01/27/i-think-you-mean-a-many-to-one-sir/> > > > > > > . > > > > > > > > On Fri, Aug 14, 2009 at 7:01 AM, Topflysecurity < > > > [email protected] > > > > > >wrote: > > > > > > > > > hi. i been checking around for a good example but did not find > one. > > > i > > > > > > > want to do a one-to-one mapping but im not sure how i should do > > > that > > > > > > > really. it is my Customer that got a CustomerConfiguration. how > > > should > > > > > > > i do a basic setup of this? > > > > > > > > > thx in advance > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" 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/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---
