That does sound like a bug. Glad you've got a work around though. On Tue, Dec 8, 2009 at 8:27 AM, Hadi Eskandari <[email protected]>wrote:
> Okay...this 'kind of' worked but with a catch, when I implementing > both interfaces on the same class, the method for > IJoinedSubclassConvention didn't even fired and only the other Apply > method for ISubclassConvention did fire. Putting them into two > separate class did work fine though. I think each class is being > probed for only one interface which is probably a bug. > > Thanks for the help. > > On Dec 8, 11:01 am, James Gregory <[email protected]> wrote: > > Sorry, I was wrong there, you need the IJoinedSubclassConvention which > > acts on subclasses that are in separate tables. ISubclassConvention is > > for subclasses that share the table of their parent (and hence the > > lack of a Table method). > > > > We should really make these simpler. > > > > On 12/8/09, Hadi Eskandari <[email protected]> wrote: > > > > > I did implement the ISubclassConvention interface, but I don't see how > > > to change the table name. It seems IClassConvention and > > > ISubclassConvention are two totally different beasts and you can not > > > change the table name with ISubclassConvention (only proxy, lazyload, > > > etc.). > > > > > On Dec 7, 5:45 pm, James Gregory <[email protected]> wrote: > > >> Although you haven't shown it, I'm assuming you're using the Subclass > > >> mapping strategy for your subclasses, so each subclass has it's own > > >> table. To change the table names of subclasses, you'll need to > > >> implement an ISubclassConvention, which is pretty much the same thing > > >> as an IClassConvention except for subclasses. You should be able to > > >> change your TablePrefixConvention to implement both interfaces. > > > > >> On 12/7/09, Hadi Eskandari <[email protected]> wrote: > > > > >> > 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]<fluent-nhibernate%[email protected]> > . > > >> > 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 > [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<fluent-nhibernate%[email protected]> > . > > > 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]<fluent-nhibernate%[email protected]> > . > 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 [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.
