It seems that the auto mapping of inheritance isn't clever enough to map
that model yet, sorry. You'll have to manually map all descendants of Asset

Sorry I hadn't spotted that sneaky one.

Andy

On Thu, Jan 8, 2009 at 3:29 PM, Adriano <adriano.mach...@gmail.com> wrote:

>
> I forgot to mention that I had already set the baseclass to my
> EntityBase class.
>
> On 8 jan, 12:00, "Andrew Stewart" <andrew.stew...@i-nnovate.net>
> wrote:
> > Hi Luis
> >
> > you need to inform automapper that your base type is EntityBase rather
> than
> > object, something similar
> > to below should do the job.
> >
> >          var autoMapper = AutoPersistenceModel
> >                     .MapEntitiesFromAssemblyOf<ExampleClass>()
> >                     .Where(t => t.Namespace ==
> > "FluentNHibernate.AutoMap.TestFixtures.SuperTypes")
> >                     .WithConvention(c =>
> >                                         {
> >                                             c.IsBaseType = b => b ==
> > typeof(EntityBase);
> >                                         });
> >
> > Cheers
> >
> > Andy
> >
> >
> >
> >
> >
> > On Thu, Jan 8, 2009 at 1:28 PM, Adriano <adriano.mach...@gmail.com>
> wrote:
> >
> > > Hi.
> >
> > > I'm new to FluentNHibernate / NHibernate, and I would like to ask you
> > > guys a question about mapping complex (or deep) inheritance
> > > situations.
> >
> > > The class hierarchy I have is the following:
> >
> > > class Asset : EntityBase
> > > {
> > >  // ...
> > > }
> >
> > > class Fund : Asset
> > > {
> > >  // ...
> > > }
> >
> > > class EquityFund : Fund
> > > {
> > >  // ...
> > > }
> >
> > > class FixedIncomeFund : Fund
> > > {
> > >  //
> > > }
> >
> > > class Trade : EntityBase
> > > {
> > >  public Asset Asset { get; set; }
> > > }
> >
> > > I would like to use the "AutoMap" feature, but NHibernate keep telling
> > > me that the class "Fund" is being duplicated in the mappings.
> >
> > > What am I missing?
> >
> > --
> > =================
> > I-nnovate Software - Bespoke Software Development, uk wirral.
> http://www.i-nnovate.net- Ocultar texto entre aspas -
> >
> > - Mostrar texto entre aspas -
> >
>


-- 
=================
I-nnovate Software - Bespoke Software Development, uk wirral.
http://www.i-nnovate.net

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