Hi, thanks for the answer. I'm looking for a way to map the stuff without a reference to the parent. The example shows part of my overall mapping. What i like to to is: Create some Classs derive from BaseAddress like CustomerBusinessAddress, ProjectDeliveryAddress ans so on and store this addresses all in one Table. Did you have any idea about doing this or any better idea?
Peter On 11 Jul., 18:36, Rasmus Hansen <ras...@gmail.com> wrote: > The type of HasMany (EmployeeHomeAddress) needs a reference to its parent, > i.e. the EmployeeHomeAddress map must have something like > > References(x => x.Employee); > > In a sense EmployeeHomeAddress owns the relationship between Employee > and EmployeeHomeAddress > > //Ras > > On Wed, Jul 11, 2012 at 6:22 PM, Peter Forstmeier < > > > > peter.forstme...@googlemail.com> wrote: > > Hi List, > > i have to following mappings: > > public EmployeeMapping(): BaseClassMap<Employee> > > { > > Id(x => x.Id); > > References(x => x.Salutation).Cascade.All().Not.LazyLoad(); > > ....... > > HasMany<EmployeeHomeAddress>(x => x.Addresses) > > .KeyColumn("Foreignkey") > > ???????? Inverse() > > NotFound.Ignore() > > > .Cascade.AllDeleteOrphan() > > .Not.LazyLoad(); > > } > > public BaseAdressMapping(): ClassMap<BaseAddress> > > { > > Table("InheritedAddresses"); > > Id(x => x.Id); > > ......... > > DiscriminateSubClassesOnColumn<string>("Type") ; > > } > > > public class > > EmployeeHomeAddressMapping :SubclassMap<EmployeeHomeAddress> > > { > > public EmployeeHomeAddressMapping() > > { > > // This mappings is empty > > } > > } > > > This mapping is only working if i didn't set Inverse() in the > > Employeemapping. > > Any idea's about this strange behavior??? > > > Thanks in advance > > Peter > > > -- > > You received this message because you are subscribed to the Google Groups > > "Fluent NHibernate" group. > > To post to this group, send email to fluent-nhibernate@googlegroups.com. > > To unsubscribe from this group, send email to > > fluent-nhibernate+unsubscr...@googlegroups.com. > > For more options, visit this group at > >http://groups.google.com/group/fluent-nhibernate?hl=en. -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.