Hi all,
i have the following classes:
Code:
public class A
{
public A(string x)
{
// code
}
//properties...
}
public class B : A
{
public B(string x) : base(x)
{
// extended code
}
}
I also have a mapping file for class A.
Now i'm trying to save an instance of B in the A Table.
The only difference to A is the constructor.
I have tried to use a simple explicit cast, but it doesn't work.
NHibernate is still aware that myB is an instance of B an throws a "no mapping file" Exception
Code:
session.save((A)myB);
My biggest problem is that i can't use a descriminator value because i can't touch the database structure.
I only want to save myB in the Table of A, there is no need to load data as an instance of B!
Is there a way to solve this Problem?
Thanks a lot
Roman