From: Kevin W. <kev...@us...> - 2004-12-31 20:57:54
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26279 Modified Files: EntityLoader.cs ICollectionInitializer.cs IUniqueEntityLoader.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: ICollectionInitializer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/ICollectionInitializer.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ICollectionInitializer.cs 2 Apr 2004 15:55:48 -0000 1.2 --- ICollectionInitializer.cs 31 Dec 2004 20:57:44 -0000 1.3 *************** *** 1,14 **** - using System; using NHibernate.Collection; using NHibernate.Engine; ! namespace NHibernate.Loader { /// <summary> /// An interface for collection loaders /// </summary> ! public interface ICollectionInitializer { - /// <summary> /// Initialize the given collection --- 1,12 ---- using NHibernate.Collection; using NHibernate.Engine; ! namespace NHibernate.Loader { /// <summary> /// An interface for collection loaders /// </summary> ! public interface ICollectionInitializer { /// <summary> /// Initialize the given collection *************** *** 18,22 **** /// <param name="owner"></param> /// <param name="session"></param> ! void Initialize(object id, PersistentCollection collection, object owner, ISessionImplementor session); } ! } --- 16,20 ---- /// <param name="owner"></param> /// <param name="session"></param> ! void Initialize( object id, PersistentCollection collection, object owner, ISessionImplementor session ); } ! } \ No newline at end of file Index: IUniqueEntityLoader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/IUniqueEntityLoader.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IUniqueEntityLoader.cs 2 Apr 2004 15:55:48 -0000 1.2 --- IUniqueEntityLoader.cs 31 Dec 2004 20:57:44 -0000 1.3 *************** *** 1,8 **** - using System; using NHibernate.Engine; ! namespace NHibernate.Loader { ! public interface IUniqueEntityLoader { /// <summary> --- 1,8 ---- using NHibernate.Engine; ! namespace NHibernate.Loader { ! /// <summary></summary> ! public interface IUniqueEntityLoader { /// <summary> *************** *** 14,18 **** /// <param name="optionalObject"></param> /// <returns></returns> ! object Load(ISessionImplementor session, object id, object optionalObject); } ! } --- 14,18 ---- /// <param name="optionalObject"></param> /// <returns></returns> ! object Load( ISessionImplementor session, object id, object optionalObject ); } ! } \ No newline at end of file Index: EntityLoader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/EntityLoader.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EntityLoader.cs 22 Nov 2004 03:53:07 -0000 1.7 --- EntityLoader.cs 31 Dec 2004 20:57:44 -0000 1.8 *************** *** 1,60 **** - using System; using System.Collections; using System.Data; - using System.Text; - using NHibernate.Engine; using NHibernate.Persister; using NHibernate.SqlCommand; using NHibernate.Type; - using NHibernate.Util; ! namespace NHibernate.Loader { /// <summary> /// Load an entity using outerjoin fetching to fetch associated entities /// </summary> ! public class EntityLoader : AbstractEntityLoader, IUniqueEntityLoader { ! private IType[] idType; ! public EntityLoader(ILoadable persister, ISessionFactoryImplementor factory) : base(persister, factory) { ! idType = new IType[] { persister.IdentifierType }; ! ! SqlSelectBuilder selectBuilder = new SqlSelectBuilder(factory); selectBuilder.SetWhereClause( Alias, persister.IdentifierColumnNames, persister.IdentifierType ); ! ! RenderStatement(selectBuilder, factory); this.SqlString = selectBuilder.ToSqlString(); ! PostInstantiate(); } ! public object Load(ISessionImplementor session, object id, object obj) { ! IList list = LoadEntity(session, new object[] { id }, idType, obj, id, false); ! if (list.Count==1) { ! return list[0]; ! } ! else if (list.Count==0) { return null; ! } ! else { throw new HibernateException( "More than one row with the given identifier was found: " + ! id + ! ", for class: " + ! Persister.ClassName); } } ! protected override object GetResultColumnOrRow(object[] row, IDataReader rs, ISessionImplementor session) { ! return row[row.Length - 1]; } } ! } --- 1,75 ---- using System.Collections; using System.Data; using NHibernate.Engine; using NHibernate.Persister; using NHibernate.SqlCommand; using NHibernate.Type; ! namespace NHibernate.Loader { /// <summary> /// Load an entity using outerjoin fetching to fetch associated entities /// </summary> ! public class EntityLoader : AbstractEntityLoader, IUniqueEntityLoader { ! private IType[ ] idType; ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! /// <param name="factory"></param> ! public EntityLoader( ILoadable persister, ISessionFactoryImplementor factory ) : base( persister, factory ) { ! idType = new IType[ ] {persister.IdentifierType}; ! ! SqlSelectBuilder selectBuilder = new SqlSelectBuilder( factory ); selectBuilder.SetWhereClause( Alias, persister.IdentifierColumnNames, persister.IdentifierType ); ! ! RenderStatement( selectBuilder, factory ); this.SqlString = selectBuilder.ToSqlString(); ! PostInstantiate(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="id"></param> ! /// <param name="obj"></param> ! /// <returns></returns> ! public object Load( ISessionImplementor session, object id, object obj ) { ! IList list = LoadEntity( session, new object[ ] {id}, idType, obj, id, false ); ! if( list.Count == 1 ) { ! return list[ 0 ]; ! } ! else if( list.Count == 0 ) { return null; ! } ! else { throw new HibernateException( "More than one row with the given identifier was found: " + ! id + ! ", for class: " + ! Persister.ClassName ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="row"></param> ! /// <param name="rs"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! protected override object GetResultColumnOrRow( object[ ] row, IDataReader rs, ISessionImplementor session ) { ! return row[ row.Length - 1 ]; } } ! } \ No newline at end of file |