Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NHibernate "illegal access to loading collection" error

What is the reason of this error? My class is Course and it has notes. Mapping is as below. Any idea?

<bag name="Notes" table="NOTE" cascade="all">
      <key column="COURSEID"/>
      <one-to-many class="Server.Data.Note, Server.Data"/>
    </bag>
like image 871
NetSide Avatar asked Nov 23 '09 15:11

NetSide


1 Answers

<bag name="Notes" table="NOTE" cascade="all" inverse="true">
      <key column="COURSEID"/>
      <one-to-many class="Server.Data.Note, Server.Data"/>
    </bag>

inverse="true" solves my problem :)

like image 166
NetSide Avatar answered Oct 14 '22 01:10

NetSide