|
From: NHibernate J. <mik...@us...> - 2007-01-09 16:11:45
|
[ http://jira.nhibernate.org/browse/NH-855?page=3Dall ] Sergey Koshcheyev updated NH-855: --------------------------------- Fix Version: LATER Priority: Major (was: Minor) Summary: Port lazy=3D"extra" from Hibernate 3 (was: Lazy collectio= n retrieval should use proxies) type: New Feature (was: Improvement) > Port lazy=3D"extra" from Hibernate 3 > ---------------------------------- > > Key: NH-855 > URL: http://jira.nhibernate.org/browse/NH-855 > Project: NHibernate > Type: New Feature > Components: Core > Versions: 1.2.0.Beta2 > Reporter: Andr=C3=A9s G. Aragoneses > Fix For: LATER > Attachments: NHibBugAboutDataRetrieval.zip > > When retrieving a lazy collection I've noted that there is much informati= on retrieved from the DB that may not be needed. For example, if we only ne= ed the Count property of the collection, NHibernate retrieves full objects = instead of just proxies (object with only the ID property filled). > I am attaching a testcase. > Note the folling C# lines in the testcase: > IList aParameters =3D oSession.CreateCriteria(typeof(Parameter)).List(); > if (aParameters.Count =3D=3D 0) > { > return; > } > Parameter oParameter =3D aParameters[0] as Parameter; > //the Group is a proxy object, so this instruction does not retrieve anyt= hing from DB > int iIdGroup =3D oParameter.Group.Id; > //this instruction unproxies the object because it is filled with its pro= perties > string sName =3D oParameter.Group.Name; > //why don't we retrieve here only proxies? because we only need to know h= ow many rows, their ID's > int iCount =3D oParameter.Group.Terminals.Count; > //if in the last instruction NHibernate would have retrieved proxies inst= ead of full objects > //this instruction would generate a new query > string sName2 =3D oParameter.Group.Terminals[0].Name; > I know that maybe this is a too specific feature and perhaps, to be imple= mented, it should be done so by adding a new configuration parameter, for e= xample: RetrievalMode.Minimal. > What do you think? > P.S.: You may add the NHib libs to the Lib subdir of the ZIP file attache= d, before building it. --=20 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 |