0
votes

I just upgraded from fluent nhibernate 1.1 (with nhibernate 3.1) to FluentNhibernate 1.3(with Nhibernate 3.3).

i have a inheritance tree where base class is abstract:

public abstract class Student {
string Firstname;
string Lastname;
}
public class DayStudent : Student {}
public class NightStudent : Student {}

public class School {
 List<Student> Students;
}

in Nhibernate 3.1 i had a table for Student(with firstname and lastname columns) and 2 other table for DayStudent and NightStudent. This is Table per conceret i had before. now in Nhibernate 3.3 it throws Exception "Cannot instantiate abstract class or interface" when i access Students collection of School class. my mapping was working greatly in nhibernate 3.1 before.

what has changed in this version? how can i fix it ?

1
It would be helpful to see your current mapping. - Handprint
Mapping written with fluent nhibernate. Student class is a class mapping. while DatStudent and NightStudet is Subclass mapping (joined class). - iBoy
what is the id-property of student? - Firo

1 Answers

0
votes

A bit late, sorry, but this reminds me of an issue I had - if you are truly using List<...> for list collections then your problem is probably there. I seem to recall that you have to use IList<...> for a list collection in persistent entities. You can still assign an instance of List to Students, you just have to declare the property of type IList<>. Hope this helps.