I'm having an inheritance model like this:
abstract class EntityBase
abstract class Person : EntityBase
class Personnel : Person
class AppUser : Person
when doing the mapping, I'm using EntityBase as layer-supertype so
there's no table for Entitybase in database. each other class is
mapped to a table.
my mapping code is this:
AutoMap.AssemblyOf<Person>()
.Where(t => typeof (EntityBase).IsAssignableFrom(t))
.Conventions.Setup(s =>
{
s.Add<TablePrefixConvention>
();
//
s.Add<ForeignKeyNameConvention>();
})
.IncludeBase<Person>()
.IgnoreBase<EntityBase>();
Now, I want to use ForeignKey / Table conventions to customize
database generations and it does not work for inherited tables.
public class TablePrefixConvention : IClassConvention{
public void Apply(IClassInstance instance){
instance.Table("tbl_" + instance.Entity.Name);
}
}
...I end up with : AppUser, tbl_Person, Personnel
I tried a ForeignKeyConvention to change the ForeignKey fields, also
it is causing me other issues.
Is this a known issue? Any workarounds? I'm using version 1.0 of FNH.
--
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.