From: Michael D. <mik...@us...> - 2004-07-29 13:04:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32597 Modified Files: TimestampType.cs Log Message: Changed TimestampType.Set to behaive like hibernate. Index: TimestampType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimestampType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TimestampType.cs 18 May 2004 05:04:12 -0000 1.5 --- TimestampType.cs 29 Jul 2004 13:04:24 -0000 1.6 *************** *** 9,13 **** /// <summary> /// This is almost the exact same type as the DateTime except it can be used ! /// in the version column and stores it to the accuracy the Database supports. /// </summary> /// <remarks> --- 9,14 ---- /// <summary> /// This is almost the exact same type as the DateTime except it can be used ! /// in the version column, stores it to the accuracy the Database supports, ! /// and will default to the value of DateTime.Now if the value is null. /// </summary> /// <remarks> *************** *** 50,59 **** } public override void Set(IDbCommand st, object value, int index) { IDataParameter parm = st.Parameters[index] as IDataParameter; ! if((DateTime)value<new DateTime(1753,1,1)) { ! parm.Value = DBNull.Value; } else --- 51,70 ---- } + /// <summary> + /// Sets the value of this Type in the IDbCommand. + /// </summary> + /// <param name="st">The IDbCommand to add the Type's value to.</param> + /// <param name="value">The value of the Type.</param> + /// <param name="index">The index of the IDataParameter in the IDbCommand.</param> + /// <remarks> + /// No null values will be written to the IDbCommand for this Type. + /// </remarks> public override void Set(IDbCommand st, object value, int index) { IDataParameter parm = st.Parameters[index] as IDataParameter; ! ! if( !(value is DateTime) ) { ! parm.Value = DateTime.Now; } else |