From: Kevin W. <kev...@us...> - 2004-12-31 17:36:53
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19280 Modified Files: Key.cs QueryParameters.cs RowSelection.cs TypedValue.cs Versioning.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: TypedValue.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/TypedValue.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TypedValue.cs 20 Feb 2003 15:57:11 -0000 1.1 --- TypedValue.cs 31 Dec 2004 17:36:41 -0000 1.2 *************** *** 1,25 **** - using System; using NHibernate.Type; ! namespace NHibernate.Engine { ! ! public sealed class TypedValue { private IType type; private object value; ! public TypedValue(IType type, object value) { this.type = type; this.value = value; } ! public object Value { get { return value; } set { this.value = value; } } ! public IType Type { get { return type; } set { type = value; } } } ! } --- 1,36 ---- using NHibernate.Type; ! namespace NHibernate.Engine ! { ! /// <summary></summary> ! public sealed class TypedValue ! { private IType type; private object value; ! /// <summary> ! /// ! /// </summary> ! /// <param name="type"></param> ! /// <param name="value"></param> ! public TypedValue( IType type, object value ) ! { this.type = type; this.value = value; } ! /// <summary></summary> ! public object Value ! { get { return value; } set { this.value = value; } } ! /// <summary></summary> ! public IType Type ! { get { return type; } set { type = value; } } } ! } \ No newline at end of file Index: Versioning.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Versioning.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Versioning.cs 28 Nov 2004 21:47:46 -0000 1.5 --- Versioning.cs 31 Dec 2004 17:36:41 -0000 1.6 *************** *** 1,15 **** ! using System; using NHibernate.Persister; using NHibernate.Type; ! namespace NHibernate.Engine { /// <summary> /// Utility methods for managing versions and timestamps /// </summary> ! public class Versioning { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(Versioning)); ! /// <summary> --- 1,15 ---- ! using log4net; using NHibernate.Persister; using NHibernate.Type; ! namespace NHibernate.Engine { /// <summary> /// Utility methods for managing versions and timestamps /// </summary> ! public class Versioning { ! private static readonly ILog log = LogManager.GetLogger( typeof( Versioning ) ); ! /// <summary> *************** *** 19,26 **** /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>Returns the next value for the version.</returns> ! public static object Increment(object version, IVersionType versionType) { ! object next = versionType.Next(version); ! if ( log.IsDebugEnabled ) log.Debug("Incrementing: " + version + " to " + next); return next; } --- 19,29 ---- /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>Returns the next value for the version.</returns> ! public static object Increment( object version, IVersionType versionType ) { ! object next = versionType.Next( version ); ! if( log.IsDebugEnabled ) ! { ! log.Debug( "Incrementing: " + version + " to " + next ); ! } return next; } *************** *** 31,38 **** /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>A seed value to initialize the versioned property with.</returns> ! public static object Seed(IVersionType versionType) { object seed = versionType.Seed; ! if ( log.IsDebugEnabled ) log.Debug("Seeding: " + seed); return seed; } --- 34,44 ---- /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>A seed value to initialize the versioned property with.</returns> ! public static object Seed( IVersionType versionType ) { object seed = versionType.Seed; ! if( log.IsDebugEnabled ) ! { ! log.Debug( "Seeding: " + seed ); ! } return seed; } *************** *** 45,56 **** /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns><c>true</c> if the version property needs to be seeded with an initial value.</returns> ! public static bool SeedVersion(object[] fields, int versionProperty, IVersionType versionType) { ! if ( fields[versionProperty]==null ) { ! fields[versionProperty] = Seed(versionType); return true; ! } ! else { return false; --- 51,62 ---- /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns><c>true</c> if the version property needs to be seeded with an initial value.</returns> ! public static bool SeedVersion( object[ ] fields, int versionProperty, IVersionType versionType ) { ! if( fields[ versionProperty ] == null ) { ! fields[ versionProperty ] = Seed( versionType ); return true; ! } ! else { return false; *************** *** 65,71 **** /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>The value of the version.</returns> ! private static object GetVersion(object[] fields, int versionProperty, IVersionType versionType) { ! return fields[versionProperty]; } --- 71,77 ---- /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>The value of the version.</returns> ! private static object GetVersion( object[ ] fields, int versionProperty, IVersionType versionType ) { ! return fields[ versionProperty ]; } *************** *** 77,83 **** /// <param name="versionProperty">The index of the version property in the <c>fields</c> parameter.</param> /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> ! private static void SetVersion(object[] fields, object version, int versionProperty, IVersionType versionType) { ! fields[versionProperty] = version; } --- 83,89 ---- /// <param name="versionProperty">The index of the version property in the <c>fields</c> parameter.</param> /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> ! private static void SetVersion( object[ ] fields, object version, int versionProperty, IVersionType versionType ) { ! fields[ versionProperty ] = version; } *************** *** 88,92 **** /// <param name="version">The value the version should be set to in the <c>fields</c> parameter.</param> /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for persisting the values of the <c>fields</c> parameter.</param> ! public static void SetVersion(object[] fields, object version, IClassPersister persister) { SetVersion( fields, version, persister.VersionProperty, persister.VersionType ); --- 94,98 ---- /// <param name="version">The value the version should be set to in the <c>fields</c> parameter.</param> /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for persisting the values of the <c>fields</c> parameter.</param> ! public static void SetVersion( object[ ] fields, object version, IClassPersister persister ) { SetVersion( fields, version, persister.VersionProperty, persister.VersionType ); *************** *** 102,113 **** /// Entity is not versioned. /// </returns> ! public static object GetVersion(object[] fields, IClassPersister persister) { ! return persister.IsVersioned ? GetVersion( fields, persister.VersionProperty, persister.VersionType) : null; } - - } ! } --- 108,117 ---- /// Entity is not versioned. /// </returns> ! public static object GetVersion( object[ ] fields, IClassPersister persister ) { ! return persister.IsVersioned ? GetVersion( fields, persister.VersionProperty, persister.VersionType ) : null; } } ! } \ No newline at end of file Index: QueryParameters.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/QueryParameters.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QueryParameters.cs 31 Oct 2004 04:30:59 -0000 1.1 --- QueryParameters.cs 31 Dec 2004 17:36:41 -0000 1.2 *************** *** 1,8 **** - using System; using System.Collections; using System.Text; ! using NHibernate.Type; - using NHibernate.Util; namespace NHibernate.Engine --- 1,6 ---- using System.Collections; using System.Text; ! using log4net; using NHibernate.Type; namespace NHibernate.Engine *************** *** 13,20 **** public class QueryParameters { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(QueryParameters) ); ! private IType[] _positionalParameterTypes; ! private object[] _positionalParameterValues; private RowSelection _rowSelection; private IDictionary _lockModes; --- 11,18 ---- public class QueryParameters { ! private static readonly ILog log = LogManager.GetLogger( typeof( QueryParameters ) ); ! private IType[ ] _positionalParameterTypes; ! private object[ ] _positionalParameterValues; private RowSelection _rowSelection; private IDictionary _lockModes; *************** *** 26,30 **** /// <param name="positionalParameterTypes">An array of <see cref="IType"/> objects for the parameters.</param> /// <param name="positionalParameterValues">An array of <see cref="object"/> objects for the parameters.</param> ! public QueryParameters(IType[] positionalParameterTypes, object[] positionalParameterValues) : this( positionalParameterTypes, positionalParameterValues, null, null ) { --- 24,28 ---- /// <param name="positionalParameterTypes">An array of <see cref="IType"/> objects for the parameters.</param> /// <param name="positionalParameterValues">An array of <see cref="object"/> objects for the parameters.</param> ! public QueryParameters( IType[ ] positionalParameterTypes, object[ ] positionalParameterValues ) : this( positionalParameterTypes, positionalParameterValues, null, null ) { *************** *** 38,42 **** /// <param name="lockModes">An <see cref="IDictionary"/> that is hql alias keyed to a LockMode value.</param> /// <param name="rowSelection"></param> ! public QueryParameters(IType[] positionalParameterTypes, object[] positionalParameterValues, IDictionary lockModes, RowSelection rowSelection) : this( positionalParameterTypes, positionalParameterValues, null, lockModes, rowSelection ) { --- 36,40 ---- /// <param name="lockModes">An <see cref="IDictionary"/> that is hql alias keyed to a LockMode value.</param> /// <param name="rowSelection"></param> ! public QueryParameters( IType[ ] positionalParameterTypes, object[ ] positionalParameterValues, IDictionary lockModes, RowSelection rowSelection ) : this( positionalParameterTypes, positionalParameterValues, null, lockModes, rowSelection ) { *************** *** 51,55 **** /// <param name="lockModes">An <see cref="IDictionary"/> that is <c>hql alias</c> keyed to a LockMode value.</param> /// <param name="rowSelection"></param> ! public QueryParameters(IType[] positionalParameterTypes, object[] positionalParameterValues, IDictionary namedParameters, IDictionary lockModes, RowSelection rowSelection) { _positionalParameterTypes = positionalParameterTypes; --- 49,53 ---- /// <param name="lockModes">An <see cref="IDictionary"/> that is <c>hql alias</c> keyed to a LockMode value.</param> /// <param name="rowSelection"></param> ! public QueryParameters( IType[ ] positionalParameterTypes, object[ ] positionalParameterValues, IDictionary namedParameters, IDictionary lockModes, RowSelection rowSelection ) { _positionalParameterTypes = positionalParameterTypes; *************** *** 86,90 **** /// of the Parameter. /// </summary> ! public IType[] PositionalParameterTypes { get { return _positionalParameterTypes; } --- 84,88 ---- /// of the Parameter. /// </summary> ! public IType[ ] PositionalParameterTypes { get { return _positionalParameterTypes; } *************** *** 96,100 **** /// of the Parameter. /// </summary> ! public object[] PositionalParameterValues { get { return _positionalParameterValues; } --- 94,98 ---- /// of the Parameter. /// </summary> ! public object[ ] PositionalParameterValues { get { return _positionalParameterValues; } *************** *** 102,108 **** } ! public bool HasRowSelection { ! get { return _rowSelection!=null; } } --- 100,107 ---- } ! /// <summary></summary> ! public bool HasRowSelection { ! get { return _rowSelection != null; } } *************** *** 123,132 **** /// <see cref="PositionalParameterValues"/> are not equal. /// </exception> ! public void ValidateParameters() { ! int typesLength = PositionalParameterTypes!=null ? 0 : PositionalParameterTypes.Length; ! int valuesLength = PositionalParameterValues!=null ? 0 : PositionalParameterValues.Length; ! if( typesLength!=valuesLength ) { throw new QueryException( "Number of positional parameter types (" + typesLength + ") does not match number of positional parameter values (" + valuesLength + ")" ); --- 122,131 ---- /// <see cref="PositionalParameterValues"/> are not equal. /// </exception> ! public void ValidateParameters() { ! int typesLength = PositionalParameterTypes != null ? 0 : PositionalParameterTypes.Length; ! int valuesLength = PositionalParameterValues != null ? 0 : PositionalParameterValues.Length; ! if( typesLength != valuesLength ) { throw new QueryException( "Number of positional parameter types (" + typesLength + ") does not match number of positional parameter values (" + valuesLength + ")" ); *************** *** 134,150 **** } ! internal void LogParameters() { StringBuilder builder = new StringBuilder(); ! ! if( PositionalParameterTypes!=null && PositionalParameterTypes.Length>0 ) { ! for( int i=0; i<PositionalParameterTypes.Length; i++ ) { ! if( PositionalParameterTypes[i]!=null ) { ! builder.Append( PositionalParameterTypes[i].Name ); } ! else { builder.Append( "null type" ); --- 133,150 ---- } ! /// <summary></summary> ! internal void LogParameters() { StringBuilder builder = new StringBuilder(); ! ! if( PositionalParameterTypes != null && PositionalParameterTypes.Length > 0 ) { ! for( int i = 0; i < PositionalParameterTypes.Length; i++ ) { ! if( PositionalParameterTypes[ i ] != null ) { ! builder.Append( PositionalParameterTypes[ i ].Name ); } ! else { builder.Append( "null type" ); *************** *** 153,161 **** builder.Append( " = " ); ! if( PositionalParameterValues[i]!=null ) { ! builder.Append( PositionalParameterValues[i].ToString() ); } ! else { builder.Append( "null value" ); --- 153,161 ---- builder.Append( " = " ); ! if( PositionalParameterValues[ i ] != null ) { ! builder.Append( PositionalParameterValues[ i ].ToString() ); } ! else { builder.Append( "null value" ); *************** *** 165,169 **** } } ! else { builder.Append( "No Types and Values" ); --- 165,169 ---- } } ! else { builder.Append( "No Types and Values" ); *************** *** 174,176 **** } } ! } --- 174,176 ---- } } ! } \ No newline at end of file Index: Key.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Key.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Key.cs 16 Dec 2004 21:55:23 -0000 1.7 --- Key.cs 31 Dec 2004 17:36:40 -0000 1.8 *************** *** 1,7 **** using System; - using NHibernate.Persister; ! namespace NHibernate.Engine { /// <summary> --- 1,6 ---- using System; using NHibernate.Persister; ! namespace NHibernate.Engine { /// <summary> *************** *** 10,21 **** /// </summary> [Serializable] ! public sealed class Key { private object id; private object identifierSpace; ! private Key(object id, object identifierSpace) { ! if (id==null) throw new ArgumentException("null identifier", "id"); this.id = id; this.identifierSpace = identifierSpace; --- 9,23 ---- /// </summary> [Serializable] ! public sealed class Key { private object id; private object identifierSpace; ! private Key( object id, object identifierSpace ) { ! if( id == null ) ! { ! throw new ArgumentException( "null identifier", "id" ); ! } this.id = id; this.identifierSpace = identifierSpace; *************** *** 27,60 **** /// <param name="id"></param> /// <param name="p"></param> ! public Key(object id, IClassPersister p) : this ( id, p.IdentifierSpace ) { } /// <summary> /// The user-visible identifier /// </summary> ! public object Identifier { get { return id; } } ! public override bool Equals(object other) { Key otherKey = other as Key; ! if(otherKey==null) { return false; } ! return otherKey.identifierSpace.Equals(this.identifierSpace) && otherKey.id.Equals(this.id); } ! public override int GetHashCode() { return id.GetHashCode(); } ! public override string ToString() ! { ! return id.ToString(); ! } } ! } --- 29,71 ---- /// <param name="id"></param> /// <param name="p"></param> ! public Key( object id, IClassPersister p ) : this( id, p.IdentifierSpace ) ! { ! } /// <summary> /// The user-visible identifier /// </summary> ! public object Identifier { get { return id; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="other"></param> ! /// <returns></returns> ! public override bool Equals( object other ) { Key otherKey = other as Key; ! if( otherKey == null ) { return false; } ! return otherKey.identifierSpace.Equals( this.identifierSpace ) && otherKey.id.Equals( this.id ); } ! /// <summary></summary> ! public override int GetHashCode() { return id.GetHashCode(); } ! /// <summary></summary> ! public override string ToString() ! { ! return id.ToString(); ! } } ! } \ No newline at end of file Index: RowSelection.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/RowSelection.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RowSelection.cs 28 Nov 2004 21:47:46 -0000 1.3 --- RowSelection.cs 31 Dec 2004 17:36:41 -0000 1.4 *************** *** 1,5 **** ! using System; ! ! namespace NHibernate.Engine { /// <summary> --- 1,3 ---- ! namespace NHibernate.Engine { /// <summary> *************** *** 7,11 **** /// records to return from the IDataReader. /// </summary> ! public sealed class RowSelection { /// <summary> --- 5,9 ---- /// records to return from the IDataReader. /// </summary> ! public sealed class RowSelection { /// <summary> *************** *** 13,17 **** /// </summary> public static readonly int NoValue = -1; ! private int firstRow = 0; private int maxRows = RowSelection.NoValue; --- 11,15 ---- /// </summary> public static readonly int NoValue = -1; ! private int firstRow = 0; private int maxRows = RowSelection.NoValue; *************** *** 23,27 **** /// <value>The Index of the First Rows to Select</value> /// <remarks>Defaults to 0 unless specifically set.</remarks> ! public int FirstRow { get { return firstRow; } --- 21,25 ---- /// <value>The Index of the First Rows to Select</value> /// <remarks>Defaults to 0 unless specifically set.</remarks> ! public int FirstRow { get { return firstRow; } *************** *** 34,38 **** /// <value>The Maximum Number of Rows to Select</value> /// <remarks>Defaults to NoValue unless specifically set.</remarks> ! public int MaxRows { get { return maxRows; } --- 32,36 ---- /// <value>The Maximum Number of Rows to Select</value> /// <remarks>Defaults to NoValue unless specifically set.</remarks> ! public int MaxRows { get { return maxRows; } *************** *** 45,49 **** /// <value>The Query Timeout</value> /// <remarks>Defaults to NoValue unless specifically set.</remarks> ! public int Timeout { get { return timeout; } --- 43,47 ---- /// <value>The Query Timeout</value> /// <remarks>Defaults to NoValue unless specifically set.</remarks> ! public int Timeout { get { return timeout; } *************** *** 51,53 **** } } ! } --- 49,51 ---- } } ! } \ No newline at end of file |