From: Michael D. <mik...@us...> - 2004-11-29 18:44:06
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24621/NHibernate/Impl Modified Files: EnumerableImpl.cs SessionImpl.cs Log Message: Added more comments around Enumerable implementation. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** SessionImpl.cs 29 Nov 2004 15:31:07 -0000 1.51 --- SessionImpl.cs 29 Nov 2004 18:43:22 -0000 1.52 *************** *** 2253,2261 **** /// later. This should return an existing proxy where appropriate. /// </summary> ! /// <param name="clazz"></param> ! /// <param name="id"></param> ! /// <param name="checkDeleted"></param> ! /// <param name="allowProxyCreation"></param> ! /// <returns></returns> private object DoLoadByClass(System.Type clazz, object id, bool checkDeleted, bool allowProxyCreation) { --- 2253,2271 ---- /// later. This should return an existing proxy where appropriate. /// </summary> ! /// <param name="clazz">The <see cref="System.Type"/> of the object to load.</param> ! /// <param name="id">The identifier of the object in the database.</param> ! /// <param name="checkDeleted"> ! /// A boolean indicating if NHiberate should check if the object has or has not been deleted. ! /// </param> ! /// <param name="allowProxyCreation">A boolean indicating if it is allowed to return a Proxy instead of an instance of the <see cref="System.Type"/>.</param> ! /// <returns> ! /// An loaded instance of the object or a proxy of the object is proxies are allowed. ! /// </returns> ! /// <remarks> ! /// If the parameter <c>checkDeleted</c> is <c>false</c> it is possible to return an object that has ! /// been deleted by the user in this <see cref="ISession"/>. If the parameter <c>checkDeleted</c> is ! /// <c>true</c> and the object has been deleted then an <see cref="ObjectDeletedException"/> will be ! /// thrown. ! /// </remarks> private object DoLoadByClass(System.Type clazz, object id, bool checkDeleted, bool allowProxyCreation) { Index: EnumerableImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/EnumerableImpl.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EnumerableImpl.cs 14 Sep 2004 17:49:55 -0000 1.6 --- EnumerableImpl.cs 29 Nov 2004 18:43:21 -0000 1.7 *************** *** 9,13 **** { /// <summary> ! /// Implements enumerable /// </summary> /// <remarks> --- 9,13 ---- { /// <summary> ! /// Provides an <see cref="IEnumerable"/> wrapper over the results of an <see cref="IQuery"/>. /// </summary> /// <remarks> *************** *** 76,81 **** --- 76,88 ---- log.Debug("retreiving next results"); _currentResults = new object[_types.Length]; + + // move through each of the ITypes contained in the IDataReader and convert them + // to their objects. for (int i=0; i<_types.Length; i++) { + // The IType knows how to extract its value out of the IDataReader. If the IType + // is a value type then the value will simply be pulled out of the IDataReader. If + // the IType is an Entity type then the IType will extract the id from the IDataReader + // and use the ISession to load an instance of the object. _currentResults[i] = _types[i].NullSafeGet(_reader, _names[i], _sess, null); } *************** *** 83,87 **** } ! public IEnumerator GetEnumerator() { --- 90,99 ---- } ! /// <summary> ! /// Returns an enumerator that can iterate through the query results. ! /// </summary> ! /// <returns> ! /// An <see cref="IEnumerator" /> that can be used to iterate through the query results. ! /// </returns> public IEnumerator GetEnumerator() { *************** *** 90,93 **** --- 102,117 ---- } + /// <summary> + /// Gets the current element in the query results. + /// </summary> + /// <value> + /// The current element in the query results which is either an object or + /// an object array. + /// </value> + /// <remarks> + /// If the <see cref="IQuery"/> only returns one type of Entity then an object will + /// be returned. If this is a multi-column resultset then an object array will be + /// returned. + /// </remarks> public object Current { *************** *** 105,108 **** --- 129,139 ---- } + /// <summary> + /// Advances the enumerator to the next element of the query results. + /// </summary> + /// <returns> + /// <c>true</c> if the enumerator was successfully advanced to the next query results + /// ; <c>false</c> if the enumerator has passed the end of the query results. + ///</returns> public bool MoveNext() { |