This method works awesome...  One follow up question, is there a way to get 
from NHibernate what key it will use to load the entity when the proxy is 
initialized?  I know I can build this functionality by hand, but was wondering 
if there was already an easy way to do it.

Thanks again!

-Sean

From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Roger 
Kratz
Sent: Tuesday, October 28, 2008 11:56 AM
To: nhusers@googlegroups.com
Subject: [nhusers] RE: Proxied entities...

NhiberateUtil.IsInitialized(entityOrCollection)

From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sean 
Fuhrmann
Sent: den 28 oktober 2008 16:04
To: nhusers@googlegroups.com
Subject: [nhusers] RE: Proxied entities...

AAAAAH...  Ok duh duh... I get it... So, 2nd question then.

Is it possible for me to figure out in NH 1.2 if the proxied entity in that 
property is loaded or not, without triggering it to load?

From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Roger 
Kratz
Sent: Tuesday, October 28, 2008 9:55 AM
To: nhusers@googlegroups.com
Subject: [nhusers] RE: Proxied entities...

A
   B

sess.load<A> won't hit the database so nhib will create an A proxy instance for 
you, making it possible to fill A (and B) with data later.

If you query for A objects (and no eager fetching is used), you will get A's 
data back and therefore a "real" A instance can be created. However B will be 
proxied (assuming lazy!=false).

Maybe you've misunderstood and thought that the "owner" should be proxied? It's 
the (unloaded) referenced objects that will be proxied.

/Roger

From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sean 
Fuhrmann
Sent: den 28 oktober 2008 15:25
To: nhusers@googlegroups.com
Subject: [nhusers] Proxied entities...

I get a little foggy when I am trying to figure out some of the dynamic proxy 
stuff...  So here is what I am seeing, could someone possibly validate that 
this is how it is supposed to work, if so why, and how?

If I load an Entity via Load<SomeEntity>, the entity comes back as a proxied 
object as I expect, it implements INHIbernateProxy, the type is actually 
DynamicProxy_Something_or_other etc, etc.

However, when entities come back from a query, they do not appear to be 
proxied, it appears to be the actual type (it does not implement 
INHIbernateProxy, and is not DynamicProxy_Something_or_other).  BUT, it still 
lazy loads properties and bags, which is what I can't seem to get my head 
around.

Are the entities coming back from a query supposed to be different?  And if so, 
how can my entity still lazy load if it is not in proxy form (it must be in 
some capacity right?) ?

Any insight on this would be great.

Thanks!!

-Sean









--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to