We are using nhibernate 1.2 and Spring (HibernateTemplate)
I am invoking the getter of a persistent object via reflection to force the lazy loading of a many-to-one association
Code:
MethodInfo getMethod = _preload.ModelType.GetProperty("GetterName").GetGetMethod();
object getterResult = getMethod.Invoke(MyObject, (Object[])null);
The problem is that the object "getterResult" is of the expected type but all properties are "null" (even the id)
i am trying to invoke the getther IN this textblock (that means that there is a session for lazy loading):
Code:
return HibernateTemplate.ExecuteFind<MyObject>(
delegate(ISession session)
{
//CODE HERE
});
If you have any solutions to this problem i would be very happy to hear them :)
thx in advance