From: Donald L M. Jr. <lu...@us...> - 2005-01-26 21:24:06
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21498/src/Nullables.NHibernate Modified Files: NullableBooleanType.cs NullableByteType.cs NullableDateTimeType.cs NullableDecimalType.cs NullableDoubleType.cs NullableGuidType.cs NullableInt16Type.cs NullableInt32Type.cs NullableInt64Type.cs NullableSingleType.cs NullableTypesType.cs Log Message: Removed the override for Get(IDataReader, string) from the individual types and implemented it in NullablesTypesType. Index: NullableInt64Type.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableInt64Type.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableInt64Type.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableInt64Type.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableInt64 has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableInt64.Default; - } - else - { - return new NullableInt64((Int64)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableByteType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableByteType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableByteType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableByteType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 65,83 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableByte has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableByte.Default; - } - else - { - return new NullableByte((Byte)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 65,68 ---- Index: NullableTypesType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableTypesType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableTypesType.cs 6 Dec 2004 03:16:59 -0000 1.2 --- NullableTypesType.cs 26 Jan 2005 21:23:53 -0000 1.3 *************** *** 56,59 **** --- 56,64 ---- } + public override object Get(System.Data.IDataReader rs, string name) + { + return Get(rs, rs.GetOrdinal(name)); + } + public abstract object NullValue{ get; } } Index: NullableDoubleType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableDoubleType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableDoubleType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableDoubleType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableDouble has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableDouble.Default; - } - else - { - return new NullableDouble((Double)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableInt32Type.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableInt32Type.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableInt32Type.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableInt32Type.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableInt32 has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableInt32.Default; - } - else - { - return new NullableInt32((Int32)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableDecimalType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableDecimalType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableDecimalType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableDecimalType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 67,85 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableDecimal has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableDecimal.Default; - } - else - { - return new NullableDecimal((Decimal)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 67,70 ---- Index: NullableInt16Type.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableInt16Type.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableInt16Type.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableInt16Type.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableInt16 has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableInt16.Default; - } - else - { - return new NullableInt16((Int16)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableDateTimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableDateTimeType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableDateTimeType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableDateTimeType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableDateTime has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableDateTime.Default; - } - else - { - return new NullableDateTime((DateTime)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableSingleType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableSingleType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableSingleType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableSingleType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 71,89 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableSingle has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableSingle.Default; - } - else - { - return new NullableSingle((Single)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 71,74 ---- Index: NullableBooleanType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableBooleanType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableBooleanType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableBooleanType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,83 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableBoolean has a method/operator/contructor that will take an object. - object value = rs[name]; - if( value==DBNull.Value ) - { - return NullableBoolean.Default; - } - else - { - return new NullableBoolean((Boolean)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- Index: NullableGuidType.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.NHibernate/NullableGuidType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableGuidType.cs 12 Nov 2004 22:08:26 -0000 1.1 --- NullableGuidType.cs 26 Jan 2005 21:23:53 -0000 1.2 *************** *** 66,84 **** } - public override object Get(System.Data.IDataReader rs, string name) - { - //TODO: perhaps NullableGuid has a method/operator/contructor that will take an object. - object value = rs[name]; - - if( value==DBNull.Value ) - { - return NullableGuid.Default; - } - else - { - return new NullableGuid((Guid)value); - } - } - public override void Set(System.Data.IDbCommand cmd, object value, int index) { --- 66,69 ---- |