The easiest way to find out is to try it, but I do believe both your examples should work.
On 1/31/09, Jimit <[email protected]> wrote: > > > How about in the case were the base class is generic, say > EntityBase<TEntity,TId>? Would FNH recognize it as a base class if I > used the open generic type (EntityBase<,>) in the predicate passed to > IsBaseType? On a related note, say the Id property is implemented as a > public readonly property on the base class and thus inherited by every > entity... Would mapping the Id as readonly with access through > camelcase field with underscore prefix still allow NH to set the Id on > derived classes even though they're not the declaring type of the > property. > > On Jan 30, 9:42 pm, James Gregory <[email protected]> wrote: >> Have you read >> this?http://blog.jagregory.com/2009/01/26/fluent-nhibernate-auto-mapping-a... >> >> If so have you tried: >> >> WithConvention(convention => >> { >> convention.IsBaseType = >> type = type == typeof(Entity) || type == typeof(User); >> >> }); >> >> On Fri, Jan 30, 2009 at 7:02 PM, Romain Verdier >> <[email protected]>wrote: >> >> >> >> > Hello there, >> >> > Using auto-mapping, how to ignore a base class that exists only in the >> > model, and that we don't want in the database? >> >> > The need is the same that for the typical base type all our entities >> > derive from, (that we specify using Conventions.IsBaseType property) >> > except that it only concern some of them. >> >> > E.g. : >> >> > class Entity { int Id } >> > class abstract User : Entity { string FirstName, string LastName } >> > class SomeKindOfUser : User { some attributes... } >> > class OtherKindOfUser : User { some other attributes } >> >> > From the previous model, I would like to end with only two tables >> > SomeKindOfUser & OtherKindOfUser. >> >> > Thanks! > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
