Hi all,
This is really making me nuts, but before debugging NH, which is my next step, I decided to post it here if someone could shed some light, that would be wonderfull.
First, imagine types A e two subclasses B and C mapped using a discriminator column. 'A' has abstract properties to force B and C map some collections, but poiting to correct types (in a similar fashion: W and subclaases X Z). That works nicely!
But...
A has also a collection of A, but as A is an abstract class I'm sure the only possible elements would be Bs and Cs, anyway, I can save elements OK, but when loading them, I get:
TestCase
----> NHibernate.ADOException : could not load object
----> System.Exception : could not initialize collection:
----> NHibernate.WrongClassException : Object with id: 1 was not of the specified sublcass: Castle.ActiveRecord.Tests.Model.StrictModel.Repository (loading object was of wrong class)
The model that reproduces the error is here:
http://svn.castleproject.org/svn/castle ... rictModel/
The test cases for it (only the last one fails):
http://svn.castleproject.org/svn/castle ... estCase.cs
Any help is appreciated!