Hello,
Can anybody tell me, please, whether it is possible to declare
access="nosetter.*" in a field mapping of collection type (e.g. IList) so that reflection optimizer could apply to the mapped class? If yes, what is wrong in the example below where reflection optimizer becomes disabled?
I tried to map classes like
Hibernate version:
1.0.2.0
Mapping documents:
Code:
<class name="Foo">
<id name="Id" type="long" unsaved-value="0" access="nosetter.camelcase-underscore">
<generator class="identity"/>
</id>
<set name="Boos" inverse="true" cascade="all" lazy="true" access="nosetter.camelcase-underscore">
<key column="FooId"/>
<one-to-many class="Boo"/>
</set>
</class>
<class name="Boo">
<id name="Id" type="long" unsaved-value="0">
<generator class="identity"/>
</id>
</class>
However this results in an NRE exception while building session factory, which effectively disables reflection optimizer for
Foo.
Debug level Hibernate log excerpt:
NHibernate.Persister.GetSetHelperFactory.CreateGetSetHelper [4952] INFO - Disabling reflection
optimizer for class Sample.Foo
NHibernate.Persister.GetSetHelperFactory.CreateGetSetHelper [4952] DEBUG - CodeDOM compilation failed
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: NHibernate at NHibernate.Persister.GetSetHelperFactory.GenerateCode() in C:\net\nHibernate-1.0.2.0\src\NHibernate\Persister\GetSetHelperFactory.cs:line 241
Thanks in advance