Regular |
|
Joined: Fri Feb 03, 2006 5:28 pm Posts: 73 Location: Québec, QC, Canada
|
Hi everyone,
I have 3 classes which 2 of them are subclass of the first one.
Member
Responsable (which is a subtype of member)
Formatteur (which is a subtype of member)
I happen to have at least one member that is both Responsable AND Formatteur. So at some point in my code, I need a list
of Formatteur.. but when nhibernate tries to load the list, it looks for that specific member and first find that he is
a Responsable, so create that member as Responsable.. but the list is suppose to be of Formatteur type. I'm then getting
this error:
Object with id: 44308 was not of the specified sublcass: Com.CompanyName.Responsable (loading object was of wrong class)
Here is what I use to get the list:
IQuery q = session.CreateQuery("from Responsable r where r.Login='" + login + "'");
responsables = q.List();
|
|