NHibernate 1.2 whose core functionality is support for generics is now available. I immediately downloaded the binaries and test it out on my test project at work (for the first time).
I did some modifications (basically changing from IList, ISet to their generics equivalents), then fire off my integration test suite which has my persistence tests. I was greeted with the following exception:
NHibernate.InvalidProxyTypeException
Message: The following types may not be used as proxies:
ProjectTracker.Core.Customer: method get_ProjectList should be virtual
ProjectTracker.Core.Customer: method get_Id should be virtual
ProjectTracker.Core.Customer: method get_Name should be virtual
ProjectTracker.Core.Customer: method get_AccountNumber should be virtual
ProjectTracker.Core.Customer: method set_AccountNumber should be virtual
ProjectTracker.Core.Customer: method get_BindableProjectList should be virtual
ProjectTracker.Core.Customer: method set_ProjectList should be virtual
ProjectTracker.Core.Customer: method set_Id should be virtual
ProjectTracker.Core.Customer: method set_Name should be virtual
Turns out that they defaulted all classes and associations to lazy load, and being lazy loaded requires these interfaces to be virtual. I just added the non lazy load settings to my mapping files and they are all green now. Just check out the migration guide here.
Posted
05-04-2007 4:48 PM
by
jokiz