Mapping a flat view to class hierarchy in fluent nHibernate

.net, c#, fluent-nhibernate, fluent-nhibernate-mapping

Solution

As comments above indicated, it was indeed `Component` that solved this.

Along the lines of the following in my `ResultMap` class:

Component(x => x.Event, m =>
            {
                m.Map(x => x.ID).Column("EventID");
                m.Map(x => x.Name).Column("EventName");
                m.Map(x => x.Description).Column("EventDescription");
            });

Problem

I'm developing an app that has a model using race results / times etc.. I've got a model that looks something like: ``` public class Competitor { public virtual int ID { get; set; } public virtual string Name { get; set; } public virtual DateTime DateOfBirth { get; set; } } public class Event { public virtual int ID { get; set; } public virtual string Name { get; set; } public virtual string Description { get; set; } } public class Result { public virtual int ID { get; set; } public virtual decimal ResultTime { get; set; } public virtual Competitor Competitor { get; set; } public virtual Event Event { get; set; } } ``` In my database, I only have access to Views which represent a "flat" view of the data. This would look something like: vResult ResultID ResultTime CompetitorID CompetitorName CompetitorDateOfBirth EventID EventName EventDescription So, I'm trying to avoid having a class that matches the above "flat" schema entirely (if possible) Is it possibly to map this with Fluent nHibernate? EDIT- It's worth mentioning, data access will be read only

Original source