I’m experiencing some problems with trying to retrieve all of my records from my DB using inheritance mapping and I was wondering if anybody could point me in the right direction.
My scenario is as follows:
I’ve got an abstract base class and three classes inheriting from my abstract base class. My mappings seem to work, I can insert records into the DB, Update and Delete the records.
However if I call the ISession.Load( AbstractBaseClass, id ) method and pass the class type as my AbstractBaseClass then this works fine and I get one of my inherited classes back. However if I try to retrieve a list of my objects by creating a criteria object with my AbstractBaseClass as the type and call ICriteria.List( ). I'm gettting an error saying that my abstract base class can’t be instantiated. Does anybody have any idea how I can retrieve a list of all my objects in one go?
Regards
Mark.
|