Hi all,

I am experimenting with abstract domain classes which I instantiate
with Castle Dynamic Proxy.  This is the error I am getting when asking
Fluent NHibernate to create my session factory:

 ---> System.NotSupportedException: Attempting to parse a null value
into an sql string (column:two0_.type).
   at NHibernate.SqlCommand.InFragment.ToFragmentString()

Here is a reduced version of my domain, note both are abstract:

    public abstract class One
    {
        public virtual int Id { get; set; }
    }

    public abstract class Two : One
    {
        public virtual string Name { get; set; }
    }

And the table-per-hierachy mapping classes that go with it:

    public class OneMap : ClassMap<One>
    {
        public OneMap()
        {
            Table("ones");
            Id(x => x.Id);
            DiscriminateSubClassesOnColumn("type");
        }
    }

    public class TwoMap : SubclassMap<Two>
    {
        public TwoMap()
        {
            DiscriminatorValue(123);
            Map(x => x.Name);
        }
    }

Is there something I can add to make it accept my abstract sub class?
As it is proxied at runtime I do not know what the type will be, I
just want anything derived from TwoMap to use 123 as it's
discriminator.

Any suggestions?

Thanks
Barry

--

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.


Reply via email to