I am working on an NHibernate exception :"base {NHibernate.HibernateException} = {"illegal access to loading collection"}"
Table PatRef is Parent table. Table PatCon is Sub table. When I retrieve data from PatRef to PatCons at debuging mode, the error message screen shot is below.
The Nhibernate data mapping screenshots are below.
Parent Table PatRef:
Sub Table PatCon:
The implement for PatRefManagerProp.GetById
The issue caused by:"a boolean field in your Project class may be marked as a varchar field in the database".
I have a database column "ON_DIALYSIS" "VARCHAR2(1)", it was mapping as a bool in mapping class PatCon
public virtual bool OnDialysis { get { return _onDialysis; } set { _onDialysis = value; } }
After fix the mapping(change bool to string), everything became beautiful :-)
public virtual string OnDialysis { get { return _onDialysis; } set { _onDialysis = value; } }