Is it possible to intercept that once you're inside a method of the 'real' Comment?
From: Ayende Rahien Sent: Thursday, December 31, 2009 10:46 AM To: [email protected] Subject: Re: [nhibernate-development] Ghost objects No, the reference should be inflated when you access the Post property. On Thu, Dec 31, 2009 at 12:44 PM, Richard Brown (gmail) <[email protected]> wrote: I take it the reference would inflate when *any* method is called on the Comment proxy? (and not just the property accessor) From: Ayende Rahien Sent: Thursday, December 31, 2009 9:32 AM To: nhibernate-development Subject: [nhibernate-development] Ghost objects I am trying to figure out if we can support the following: class Comment { public virtual Post Post {get;set;} } class Post {} class Article : Post {} And not generate a PostProxy for the property, but instead detect the property access, force a load to return the correct type. We can do it right now by specifying lazy=false, but that pre-load the entity, while I would like to try to get it to load only on access time. There are several potential problems with this: a) we need to replace the reference on first access, which means that the _parent_ must be a proxy as well. b) we disallow field access entirely. c) identity map issues? other thoughts?
