Earlier today, I broke one of my classes into two, by marking the original as abstract, and creating two subclasses that inherit from the abstract base.
I added a line to my FluentNHibernate mapping to discriminate the subclasses based on a column value (table-per-class heirarchy) as follows:
DiscriminateSubClassesOnColumn("EntryType");
That field is an integer in the database.
My new mappings inherit from
SubClassMap<MyChildType>
With a new line in the constructor method of MyChildTypeMap for the discriminator as follows:
DiscriminatorValue(1);
I am continuously running into this exception:
"Duplicate class/entity mapping MyNamespace.MyChildObject"
In the Fluent NHibernate session builder, (Fluently.Configure()....) I added the line to export the mappings to hbm files. Sure enough, the subclass is listed twice in the mapping file of the parent class.
I am not using AutoMapped configurations. I am using Fluent NHibernate 1.2.0.0 I am using NHibernate 3.2.0.400
I'm at wit's end trying to figure out where this comes from. Can anyone help?