Just reviewed the sample from the wiki.
http://wiki.fluentnhibernate.org/show/AutoMappingInheritance
This works unless you add a 4 class. Meaning the superguest does not
get created.
There seems to be a problem with the 4 class being added.
----
using System;
public class Person
{
public virtual int Id { get; set; }
public virtual string FirstName { get; set; }
public virtual string LastName { get; set; }
}
public class Employee : Person
{
public virtual DateTime StartDate { get; set; }
}
public class Guest : Person
{
public virtual int GuestPassId { get; set; }
}
public class SuperGuest : Guest
{
public virtual int SuperGuestPassId { get; set; }
}
On Mar 27, 2:15 pm, BringerOD <[email protected]> wrote:
> How do I configure fluent to have joined sub classes?
>
> I have tried this, but is says " Duplicate class/entity mapping
> MTGSS.Core.ClassB "
>
> If I remove the override "IAutoMappingOverride<ClassB>", then mapping
> does not include class c.
>
> Any suggestions?
>
> ------
>
> public class UserMap : IAutoMappingOverride<ClassB>
> {
> public void Override(AutoMap<ClassB> mapping)
> {
> mapping.JoinedSubClass("ID",ClassCMap());
>
> }
>
> private static Action<AutoJoinedSubClassPart<ClassC>> ClassCMap
> ()
> {
> return (js =>
> {
> js.Map(c => c.CVariable1);
> });
> }
>
> }
> -----
>
> namespace MTGSS.Core
> {
> using SharpArch.Core.DomainModel;
>
> public class ClassA :Entity
> {
>
> public virtual string AVariable1 { get; set; }
> }
>
> public class ClassB : ClassA
> {
> public virtual string BVariable1 { get; set; }
> }
>
> public class ClassC : ClassB
> {
> public virtual string CVariable1 { get; set; }
> }
>
> public class ClassD : ClassA
> {
> public virtual string DVariable1 { get; set; }
> }
>
>
>
> }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---