These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: lazy loading via reflection
PostPosted: Thu Apr 03, 2008 10:11 am 
Newbie

Joined: Thu Apr 03, 2008 6:57 am
Posts: 2
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.