Fwd: [nhibernate-issues] [JIRA] Updated: (NH-573) New method to "completely load" a proxy.

"Ayende Rahien" <[email protected]> Sat, 4 Oct 2008 23:25:00 +0300
Newsgroups gmane.comp.windows.dotnet.nhibernate.devel
Message-ID <[email protected]>
--===============2727212334080346396==
Content-Type: multipart/alternative; 
	boundary="----=_Part_18350_5962070.1223151900389"

------=_Part_18350_5962070.1223151900389
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

How was this fix? I am not seeing a related checkin

---------- Forwarded message ----------
From: NHibernate Jira <[email protected]>
Date: Tue, Sep 30, 2008 at 3:47 PM
Subject: [nhibernate-issues] [JIRA] Updated: (NH-573) New method to
"completely load" a proxy.
To: [email protected]



    [
http://jira.nhibernate.org/browse/NH-573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]

Fabio Maulo updated NH-573:
---------------------------

   Fix Version/s:     (was: 2.1.0.Alpha1)

> New method to "completely load" a proxy.
> ----------------------------------------
>
>                 Key: NH-573
>                 URL: http://jira.nhibernate.org/browse/NH-573
>             Project:  NHibernate
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 1.0.2
>            Reporter: Jerome Haltom
>            Priority: Minor
>
> A lot of the time I find myself in a position to need to know the runtime
type of a mapped class. Proxies break this by design, which isn't itself a
problem, but I need a way around it.
> Contract.Client is of type Client. Institution inherits from Client.
Contract.Client may be an Institution. The only way to know is to attempt to
load the Client object. The proxy however subclasses Client, without loading
Institution. This results in the expression "contract.Client is Institution"
never being valid.
> I'm not suggesting you fix this, as it's not really fixable by my view. I
just need a quick way to get around it. I suggest a method like the
following:
> session.Get(contract, "Client")
> This expression, or one similar to it, would immediatly go to the database
and retrieve the proper type for the Client property, and set it. It would
make situations like this much easier to work around.
> This method should also fix up any other references to the same instance
in the entire session.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.nhibernate.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
nhibernate-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nhibernate-issues

------=_Part_18350_5962070.1223151900389
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr">How was this fix? I am not seeing a related checkin<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">NHibernate Jira</b> <span dir="ltr">&lt;<a href="mailto:[email protected]">[email protected]</a>&gt;</span><br>
Date: Tue, Sep 30, 2008 at 3:47 PM<br>Subject: [nhibernate-issues] [JIRA] Updated: (NH-573) New method to &quot;completely load&quot; a proxy.<br>To: <a href="mailto:[email protected]">[email protected]</a><br>
<br><br><br>
 &nbsp; &nbsp; [ <a href="http://jira.nhibernate.org/browse/NH-573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel" target="_blank">http://jira.nhibernate.org/browse/NH-573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel</a> ]<br>

<br>
Fabio Maulo updated NH-573:<br>
---------------------------<br>
<br>
 &nbsp; &nbsp;Fix Version/s: &nbsp; &nbsp; (was: 2.1.0.Alpha1)<br>
<br>
&gt; New method to &quot;completely load&quot; a proxy.<br>
&gt; ----------------------------------------<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Key: NH-573<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; URL: <a href="http://jira.nhibernate.org/browse/NH-573" target="_blank">http://jira.nhibernate.org/browse/NH-573</a><br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Project: &nbsp;NHibernate<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Issue Type: New Feature<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Components: Core<br>
&gt; &nbsp; &nbsp;Affects Versions: 1.0.2<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Reporter: Jerome Haltom<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Priority: Minor<br>
&gt;<br>
&gt; A lot of the time I find myself in a position to need to know the runtime type of a mapped class. Proxies break this by design, which isn&#39;t itself a problem, but I need a way around it.<br>
&gt; Contract.Client is of type Client. Institution inherits from Client. Contract.Client may be an Institution. The only way to know is to attempt to load the Client object. The proxy however subclasses Client, without loading Institution. This results in the expression &quot;contract.Client is Institution&quot; never being valid.<br>

&gt; I&#39;m not suggesting you fix this, as it&#39;s not really fixable by my view. I just need a quick way to get around it. I suggest a method like the following:<br>
&gt; session.Get(contract, &quot;Client&quot;)<br>
&gt; This expression, or one similar to it, would immediatly go to the database and retrieve the proper type for the Client property, and set it. It would make situations like this much easier to work around.<br>
&gt; This method should also fix up any other references to the same instance in the entire session.<br>
<br>
--<br>
This message is automatically generated by JIRA.<br>
-<br>
If you think it was sent incorrectly contact one of the administrators: <a href="http://jira.nhibernate.org/secure/Administrators.jspa" target="_blank">http://jira.nhibernate.org/secure/Administrators.jspa</a><br>
-<br>
For more information on JIRA, see: <a href="http://www.atlassian.com/software/jira" target="_blank">http://www.atlassian.com/software/jira</a><br>
<br>
<br>
<br>
-------------------------------------------------------------------------<br>
This SF.Net email is sponsored by the Moblin Your Move Developer&#39;s challenge<br>
Build the coolest Linux based applications with Moblin SDK &amp; win great prizes<br>
Grand prize is a trip for two to an Open Source event anywhere in the world<br>
<a href="http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/" target="_blank">http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/</a><br>
_______________________________________________<br>
nhibernate-issues mailing list<br>
<a href="mailto:[email protected]">[email protected]</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nhibernate-issues" target="_blank">https://lists.sourceforge.net/lists/listinfo/nhibernate-issues</a><br>
</div><br></div>

------=_Part_18350_5962070.1223151900389--


--===============2727212334080346396==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
--===============2727212334080346396==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Nhibernate-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nhibernate-development

--===============2727212334080346396==--