From: NHibernate J. <mik...@us...> - 2006-11-13 18:04:01
|
[ http://jira.nhibernate.org/browse/NH-573?page=all ] Sergey Koshcheyev updated NH-573: --------------------------------- Fix Version: LATER Component: Core > New method to "completely load" a proxy. > ---------------------------------------- > > Key: NH-573 > URL: http://jira.nhibernate.org/browse/NH-573 > Project: NHibernate > Type: New Feature > Components: Core > Versions: 1.0.2 > Reporter: Jerry Haltom > Priority: Minor > Fix For: LATER > > 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 |