After some digging, I've found IJoinedSubclassConvention that is being invoked when mapping. I've found ISubclassConvention as well, but that is not being invoked. I guess joined subclass is the default and that any other convention needs to be configured somewhere else(?).
Either way, I'm stumped on what I'm supposed to do in the IJoinedSubclassConvention.Apply() method. I have a IJoinedSubclassInstance that doesn't look like any other mapping object, so I'm wondering what I'm supposed to do with it to make joined subclasses follow conventions wrt foreign key naming, ID naming, etc. Does anyone have any examples of an IJoinedSubclassConvention implementation? The API documentation is rather ... sparse: http://fluentnhibernate.org/api/FluentNHibernate.Conventions/IJoinedSubclassConvention.htm :-) -- Asbjørn Ulsberg -=|=- [email protected] (mailto:[email protected]) «He's a loathsome offensive brute, yet I can't look away» On mandag 26. september 2011 at 14:46, Asbjørn Ulsberg wrote: > Hey. > > I have a lot of entities in my domain model that I want to map with subclass > mapping. I'm really uncertain how this is best done in FNH these days. The > only examples I find online are for fluent mappings, not for automapping. I'd > like the conventions I've defined to apply to all subclassed entities, but if > I try something like this in an IAutoMappingOverride: > > mapping.JoinedSubClass<Child>("Type"); > > The Child object won't be mapped according to conventions. If I try the > following: > > mapping.SubClass<Child>(1, x => { }) > > FNH throws the following exception: > > System.MissingMethodException: Constructor on type > 'FluentNHibernate.Automapping.AutoSubClassPart`1[[Child]]' not found > > Creating an implementation of AutoSubClassPart<Child> doesn't help either, > and I'm not sure this is a class I'm supposed to implement either way. I > guess not. I'm having difficulties figuring out how subclass mapping can be > done combined with automapping. Is it possible or do I have to revert to > static fluent mapping (that disregard my lovely conventions)? > > -- > Asbjørn Ulsberg -=|=- [email protected] (mailto:[email protected]) > «He's a loathsome offensive brute, yet I can't look away» -- 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.
