From: Michael D. <mik...@us...> - 2004-10-19 02:24:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18017/NHibernate/Type Modified Files: DateTimeType.cs DateType.cs Int16Type.cs Int32Type.cs Int64Type.cs IVersionType.cs TicksType.cs TimeSpanType.cs TimestampType.cs TimeType.cs Log Message: Minor fixups to some of the IVersionTypes. Index: TimestampType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimestampType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TimestampType.cs 20 Sep 2004 03:00:29 -0000 1.8 --- TimestampType.cs 19 Oct 2004 02:24:08 -0000 1.9 *************** *** 96,99 **** --- 96,101 ---- } + #region IVersionType Members + public object Next(object current) { *************** *** 106,109 **** --- 108,113 ---- } + #endregion + public override string ObjectToSQLString(object value) { Index: DateTimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateTimeType.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DateTimeType.cs 20 Sep 2004 03:00:29 -0000 1.10 --- DateTimeType.cs 19 Oct 2004 02:24:08 -0000 1.11 *************** *** 98,101 **** --- 98,103 ---- } + #region IVersionType Members + public object Next(object current) { *************** *** 107,110 **** --- 109,115 ---- get { return DateTime.Now; } } + + #endregion + } } Index: TimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TimeType.cs 20 Sep 2004 03:00:29 -0000 1.6 --- TimeType.cs 19 Oct 2004 02:24:08 -0000 1.7 *************** *** 14,18 **** /// using this Type indicates that you don't care about the Date portion of the DateTime. /// </remarks> ! public class TimeType : ValueTypeType, IIdentifierType, ILiteralType, IVersionType { internal TimeType() : base( new TimeSqlType() ) --- 14,18 ---- /// using this Type indicates that you don't care about the Date portion of the DateTime. /// </remarks> ! public class TimeType : ValueTypeType, IIdentifierType, ILiteralType { internal TimeType() : base( new TimeSqlType() ) *************** *** 86,99 **** return "'" + ((DateTime)value).ToShortTimeString() + "'"; } - - public object Next(object current) - { - return Seed; - } - - public object Seed - { - get { return DateTime.Now; } - } } } --- 86,89 ---- Index: Int16Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int16Type.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Int16Type.cs 20 Sep 2004 03:00:29 -0000 1.4 --- Int16Type.cs 19 Oct 2004 02:24:08 -0000 1.5 *************** *** 39,48 **** } ! public object Next(object current) { return ((short)current) + 1; } ! public object Seed { get { return 0; } } } } --- 39,56 ---- } ! #region IVersionType Members ! ! public object Next(object current) ! { return ((short)current) + 1; } ! ! public object Seed ! { get { return 0; } } + + #endregion + } } Index: DateType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateType.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DateType.cs 20 Sep 2004 03:00:29 -0000 1.10 --- DateType.cs 19 Oct 2004 02:24:08 -0000 1.11 *************** *** 3,9 **** using NHibernate.SqlTypes; ! namespace NHibernate.Type { ! public class DateType : ValueTypeType, IIdentifierType, ILiteralType, IVersionType { internal DateType() : base( new DateSqlType() ) --- 3,11 ---- using NHibernate.SqlTypes; ! namespace NHibernate.Type ! { ! public class DateType : ValueTypeType, IIdentifierType, ILiteralType ! { internal DateType() : base( new DateSqlType() ) *************** *** 72,85 **** return "'" + ((DateTime)value).ToShortDateString() + "'"; } - - public object Next(object current) - { - return Seed; - } - - public object Seed - { - get { return DateTime.Now; } - } } } --- 74,77 ---- Index: Int32Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int32Type.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Int32Type.cs 20 Sep 2004 03:00:29 -0000 1.5 --- Int32Type.cs 19 Oct 2004 02:24:08 -0000 1.6 *************** *** 41,45 **** } ! public virtual object Next(object current) { return ((int) current) + 1; } --- 41,48 ---- } ! #region IVersionType Members ! ! public virtual object Next(object current) ! { return ((int) current) + 1; } *************** *** 48,51 **** --- 51,57 ---- get { return 0; } } + + #endregion + } } \ No newline at end of file Index: TimeSpanType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeSpanType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TimeSpanType.cs 20 Sep 2004 03:00:29 -0000 1.5 --- TimeSpanType.cs 19 Oct 2004 02:24:08 -0000 1.6 *************** *** 62,65 **** --- 62,67 ---- } + #region IVersionType Members + public object Next(object current) { *************** *** 69,75 **** public object Seed { ! get { return DateTime.Now.Ticks; } } public override string ObjectToSQLString(object value) { --- 71,79 ---- public object Seed { ! get { return new TimeSpan( DateTime.Now.Ticks ); } } + #endregion + public override string ObjectToSQLString(object value) { Index: Int64Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int64Type.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Int64Type.cs 20 Sep 2004 03:00:29 -0000 1.4 --- Int64Type.cs 19 Oct 2004 02:24:08 -0000 1.5 *************** *** 6,10 **** namespace NHibernate.Type { ! public class Int64Type : ValueTypeType, IIdentifierType, IVersionType { internal Int64Type() : base( new Int64SqlType() ) --- 6,11 ---- namespace NHibernate.Type { ! public class Int64Type : ValueTypeType, IIdentifierType, IVersionType ! { internal Int64Type() : base( new Int64SqlType() ) *************** *** 37,41 **** } ! public object Next(object current) { return ((long)current) + 1; } --- 38,45 ---- } ! #region IVersionType Members ! ! public object Next(object current) ! { return ((long)current) + 1; } *************** *** 45,49 **** } ! public override string ObjectToSQLString(object value) { return value.ToString(); } --- 49,56 ---- } ! #endregion ! ! public override string ObjectToSQLString(object value) ! { return value.ToString(); } Index: IVersionType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IVersionType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IVersionType.cs 17 Feb 2004 03:29:34 -0000 1.4 --- IVersionType.cs 19 Oct 2004 02:24:08 -0000 1.5 *************** *** 9,12 **** --- 9,18 ---- public interface IVersionType : IType { + /// <summary> + /// When implemented by a class, increments the version. + /// </summary> + /// <param name="current">The current version</param> + /// <returns>an instance of the <see cref="IType"/> that has been incremented.</returns> + object Next(object current); /// <summary> *************** *** 16,25 **** object Seed { get; } ! /// <summary> ! /// When implemented by a class, increments the version. ! /// </summary> ! /// <param name="current">The current version</param> ! /// <returns>an instance of the <see cref="IType"/> that has been incremented.</returns> ! object Next(object current); } ! } \ No newline at end of file --- 22,26 ---- object Seed { get; } ! } ! } Index: TicksType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TicksType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TicksType.cs 20 Sep 2004 03:00:29 -0000 1.5 --- TicksType.cs 19 Oct 2004 02:24:08 -0000 1.6 *************** *** 67,70 **** --- 67,72 ---- } + #region IVersionType Members + public object Next(object current) { *************** *** 74,80 **** public object Seed { ! get { return DateTime.Now.Ticks; } } public override string ObjectToSQLString(object value) { --- 76,84 ---- public object Seed { ! get { return DateTime.Now; } } + #endregion + public override string ObjectToSQLString(object value) { |