AFAIK is that lazy properties rely on dynamic proxies. Defining lazy=false on the class level would result in not using dynamic proxies. This means that lazy property behavior cannot be extended.
Set lazy=true at the class level so that the dynamic proxies are used and then lazy properties should work. Maybe I'm incorrect here as this is just a thought. You could try resulting the actual type of the class returned by NHibernate. When the type is the actual type then you know that no dynamic proxy is generated so it is impossible to have lazy properties. Ramon On Sun, Jul 8, 2012 at 5:49 AM, Kyle <[email protected]> wrote: > Hi,guys > > When I try to use lazy load features of nhibernate recently, I only > succeed lazy loading the whole class and collections of class and failed to > load properties lazily. Even though nhibernate 3 only uses LiuFu to make > default proxyfactoryfactory, lazy properties feature should be one of its > features, right? Some infomation on web told me lazy properties were only > supported by Castle in the older version, e.g. 3.2 . > > I have assigne lazy=false at class level, assigned a virtual string > property(varchar in db) and a virtual collection property to be lazy, and > use session.load to query. According to the log, string property did be > queried and collection did not. According to the post on web, if string > property was lazy loaded, the relavent column name should not be in the > select sql, right? > > Is there something wrong in my way to lazy load properties? Or I still > have to implement Castle to make lazy property feature work? > > Thank you all. > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/nhusers/-/A0TaZwf4lZwJ. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- Ramon -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
