A follow-up: If u set the DiscriminatorColumn in the setup part of
AutoMapper you can change the name of the column, ie:

DiscriminatorColumn = type => (type == typeof(MyClass)) ?
"IsHomeTeam" : "discriminator";

But I've been having no luck in determining a way to set
DiscriminatorColumn type and removed the classes altogether from
AutoMapping (btw, we should really make this easier, the ignoring from
automapper part).

Best of luck,
Felipe

On Apr 10, 1:14 pm, reach4thelasers <kev.m.mul...@googlemail.com>
wrote:
> I've been searching for a solution to this all day.  Does anyone have
> a solution?
>
> On Mar 22, 7:06 pm, kberridge <kevin.w.berri...@gmail.com> wrote:
>
> > Last check, can anyone provide any direction for me on this?
>
> > Thanks,
> > Kevin
>
> > On Mar 9, 6:37 pm, kberridge <kevin.w.berri...@gmail.com> wrote:
>
> > > Hi,
> > > I'm looking for an example of how to use a table-per-class-hierarchies
> > > with Automapper.
>
> > > I've setup my automappings so the default Subclass Strategy is
> > > Subclass:
> > > autoMappings.Setup( s => s.SubclassStrategy = t =>
> > > SubclassStrategy.Subclass );
>
> > > I've included the parent of the class Hierarchy with:
> > > autoMappings.IncludeBase<Parent>();
>
> > > I have also defined an IAutoMappingOverride for the Parent:
> > > public class ParentOverrideMap : IAutoMappingOverride<Parent>
> > > {
> > >   public void
> > > Override( FluentNHibernate.Automapping.AutoMapping<Parent> mapping )
> > >   {
> > >     mapping.DiscriminateSubClassesOnColumn( "Type" );
> > >     mapping.SubClass<ChildA>( "ChildA" );
> > >   }
>
> > > }
>
> > > From what I've read on the Wiki on in various Google searches it seems
> > > like that should work, but when I test it by using the SchemaExport
> > > tool, it builds the table with the discriminator column name as
> > > "discriminator" instead of "Type".  So it seems my overrides aren't
> > > working.
>
> > > The documentation on the Wiki doesn't cover this, so I've mostly been
> > > guessing, that's why I'm wondering if anyone could point me to an
> > > article somewhere with a good example of using the table-per-class-
> > > hierarchy strategy with automappings.
>
> > > Thanks,
> > > Kevin

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@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.

Reply via email to