Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10443/src/NHibernate/Type Modified Files: BooleanType.cs ByteType.cs CharType.cs DateTimeType.cs DateType.cs DecimalType.cs DoubleType.cs GuidType.cs ImmutableType.cs Int16Type.cs Int32Type.cs Int64Type.cs NullableType.cs ObjectType.cs PersistentEnumType.cs SingleType.cs TicksType.cs TimeSpanType.cs TimestampType.cs TimeType.cs Added Files: ValueTypeType.cs Removed Files: PrimitiveType.cs Log Message: Refactored ValueTypes to inherit from ValueTypeType instead of PrimitiveType. Removed PrimitiveClass property so that changed Binder & QueryTranslator - it is not applicable in .net since the type system has no 'Primitives' Index: TimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TimeType.cs 21 Aug 2004 16:37:33 -0000 1.5 --- TimeType.cs 20 Sep 2004 03:00:29 -0000 1.6 *************** *** 14,18 **** /// using this Type indicates that you don't care about the Date portion of the DateTime. /// </remarks> ! public class TimeType : MutableType, 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, IVersionType { internal TimeType() : base( new TimeSqlType() ) *************** *** 72,81 **** } - public override object DeepCopyNotNull(object value) - { - DateTime old = (DateTime) value; - return new DateTime(1, 1, 1, old.Hour, old.Month, old.Day); - } - public override bool HasNiceEquals { --- 72,75 ---- *************** *** 88,94 **** } ! public string ObjectToSQLString(object value) { ! return "'" + value.ToString() + "'"; } --- 82,88 ---- } ! public override string ObjectToSQLString(object value) { ! return "'" + ((DateTime)value).ToShortTimeString() + "'"; } Index: ByteType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ByteType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ByteType.cs 21 Aug 2004 16:37:32 -0000 1.6 --- ByteType.cs 20 Sep 2004 03:00:29 -0000 1.7 *************** *** 10,14 **** /// ByteType. /// </summary> ! public class ByteType : PrimitiveType, IDiscriminatorType { internal ByteType() : base( new ByteSqlType() ) --- 10,14 ---- /// ByteType. /// </summary> ! public class ByteType : ValueTypeType, IDiscriminatorType { internal ByteType() : base( new ByteSqlType() ) *************** *** 24,31 **** } - public override System.Type PrimitiveClass { - get { return typeof(byte); } - } - public override System.Type ReturnedClass { get { return typeof(byte); } --- 24,27 ---- Index: DateType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateType.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DateType.cs 21 Aug 2004 16:37:32 -0000 1.9 --- DateType.cs 20 Sep 2004 03:00:29 -0000 1.10 *************** *** 5,9 **** namespace NHibernate.Type { ! public class DateType : MutableType, IIdentifierType, ILiteralType, IVersionType { internal DateType() : base( new DateSqlType() ) --- 5,9 ---- namespace NHibernate.Type { ! public class DateType : ValueTypeType, IIdentifierType, ILiteralType, IVersionType { internal DateType() : base( new DateSqlType() ) *************** *** 22,26 **** } ! public override System.Type ReturnedClass { get { return typeof(DateTime); } } --- 22,27 ---- } ! public override System.Type ReturnedClass ! { get { return typeof(DateTime); } } *************** *** 60,68 **** } - public override object DeepCopyNotNull(object value) { - DateTime old = (DateTime) value; - return new DateTime(old.Year, old.Month, old.Day); - } - public override bool HasNiceEquals { get { return true; } --- 61,64 ---- *************** *** 73,78 **** } ! public string ObjectToSQLString(object value) { ! return "'" + value.ToString() + "'"; } --- 69,74 ---- } ! public override string ObjectToSQLString(object value) { ! return "'" + ((DateTime)value).ToShortDateString() + "'"; } Index: Int16Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int16Type.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Int16Type.cs 21 Aug 2004 16:37:33 -0000 1.3 --- Int16Type.cs 20 Sep 2004 03:00:29 -0000 1.4 *************** *** 6,10 **** namespace NHibernate.Type { ! public class Int16Type : PrimitiveType, IDiscriminatorType, IVersionType { internal Int16Type() : base( new Int16SqlType() ) --- 6,10 ---- namespace NHibernate.Type { ! public class Int16Type : ValueTypeType, IDiscriminatorType, IVersionType { internal Int16Type() : base( new Int16SqlType() ) *************** *** 19,25 **** return Convert.ToInt16(rs[name]); } ! public override System.Type PrimitiveClass { ! get { return typeof(System.Int16); } ! } public override System.Type ReturnedClass { get { return typeof(System.Int16); } --- 19,23 ---- return Convert.ToInt16(rs[name]); } ! public override System.Type ReturnedClass { get { return typeof(System.Int16); } Index: DecimalType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DecimalType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DecimalType.cs 21 Aug 2004 16:37:32 -0000 1.5 --- DecimalType.cs 20 Sep 2004 03:00:29 -0000 1.6 *************** *** 10,14 **** /// DecimalType /// </summary> ! public class DecimalType : PrimitiveType, IIdentifierType { internal DecimalType() : this( new DecimalSqlType() ) --- 10,14 ---- /// DecimalType /// </summary> ! public class DecimalType : ValueTypeType, IIdentifierType { internal DecimalType() : this( new DecimalSqlType() ) *************** *** 30,38 **** } - public override System.Type PrimitiveClass - { - get { return typeof(Decimal); } - } - public override System.Type ReturnedClass { --- 30,33 ---- Index: GuidType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/GuidType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GuidType.cs 21 Aug 2004 16:37:32 -0000 1.3 --- GuidType.cs 20 Sep 2004 03:00:29 -0000 1.4 *************** *** 7,11 **** { ! public class GuidType : PrimitiveType, IDiscriminatorType { --- 7,11 ---- { ! public class GuidType : ValueTypeType, IDiscriminatorType { *************** *** 24,32 **** } - public override System.Type PrimitiveClass - { - get { return typeof(System.Guid); } - } - public override System.Type ReturnedClass { --- 24,27 ---- Index: SingleType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SingleType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SingleType.cs 21 Aug 2004 16:37:33 -0000 1.4 --- SingleType.cs 20 Sep 2004 03:00:29 -0000 1.5 *************** *** 14,18 **** /// matches up with the capabilities of System.Single /// </remarks> ! public class SingleType : PrimitiveType { internal SingleType() : base( new SingleSqlType() ) --- 14,18 ---- /// matches up with the capabilities of System.Single /// </remarks> ! public class SingleType : ValueTypeType { internal SingleType() : base( new SingleSqlType() ) *************** *** 30,38 **** } - public override System.Type PrimitiveClass - { - get { return typeof(System.Single); } - } - public override System.Type ReturnedClass { --- 30,33 ---- Index: BooleanType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/BooleanType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BooleanType.cs 21 Aug 2004 16:37:32 -0000 1.8 --- BooleanType.cs 20 Sep 2004 03:00:29 -0000 1.9 *************** *** 15,19 **** /// from Hibernate so I am not sure how/if they apply to NHibernate /// </remarks> ! public class BooleanType : PrimitiveType, IDiscriminatorType { private static readonly string TRUE = "1"; --- 15,19 ---- /// from Hibernate so I am not sure how/if they apply to NHibernate /// </remarks> ! public class BooleanType : ValueTypeType, IDiscriminatorType { private static readonly string TRUE = "1"; *************** *** 47,54 **** return Convert.ToBoolean(rs[name]); } - - public override System.Type PrimitiveClass { - get { return typeof(bool); } - } public override System.Type ReturnedClass { --- 47,50 ---- Index: Int64Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int64Type.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Int64Type.cs 21 Aug 2004 16:37:33 -0000 1.3 --- Int64Type.cs 20 Sep 2004 03:00:29 -0000 1.4 *************** *** 6,10 **** namespace NHibernate.Type { ! public class Int64Type : PrimitiveType, IIdentifierType, IVersionType { internal Int64Type() : base( new Int64SqlType() ) --- 6,10 ---- namespace NHibernate.Type { ! public class Int64Type : ValueTypeType, IIdentifierType, IVersionType { internal Int64Type() : base( new Int64SqlType() ) *************** *** 20,27 **** } - public override System.Type PrimitiveClass { - get { return typeof(System.Int64); } - } - public override System.Type ReturnedClass { get { return typeof(System.Int64); } --- 20,23 ---- Index: NullableType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/NullableType.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NullableType.cs 31 Aug 2004 13:14:26 -0000 1.10 --- NullableType.cs 20 Sep 2004 03:00:29 -0000 1.11 *************** *** 6,10 **** using NHibernate.Util; - namespace NHibernate.Type { --- 6,9 ---- *************** *** 12,18 **** /// Superclass of single-column nullable types. /// </summary> ! /// <remarks>Maps the Property to a single column that is capable of storing nulls.</remarks> ! public abstract class NullableType : AbstractType { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(NullableType)); /// <summary> --- 11,22 ---- /// Superclass of single-column nullable types. /// </summary> ! /// <remarks> ! /// Maps the Property to a single column that is capable of storing nulls in it. If a .net Struct is ! /// used it will be created with its unitialized value and then on Update the uninitialized value of ! /// the Struct will be written to the column - not <c>null</c>. ! /// </remarks> ! public abstract class NullableType : AbstractType ! { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(NullableType) ); /// <summary> *************** *** 131,138 **** /// </para> /// </remarks> ! public void NullSafeSet(IDbCommand cmd, object value, int index) { ! if (value==null) { ! if ( log.IsDebugEnabled ) log.Debug("binding null to parameter: " + index.ToString()); //Do we check IsNullable? --- 135,146 ---- /// </para> /// </remarks> ! public void NullSafeSet(IDbCommand cmd, object value, int index) ! { ! if (value==null) ! { ! if ( log.IsDebugEnabled ) ! { log.Debug("binding null to parameter: " + index.ToString()); + } //Do we check IsNullable? *************** *** 142,148 **** ( (IDataParameter)cmd.Parameters[index]).Value = DBNull.Value; } ! else { ! if ( log.IsDebugEnabled ) log.Debug("binding '" + ToXML(value) + "' to parameter: " + index); Set(cmd, value, index); --- 150,159 ---- ( (IDataParameter)cmd.Parameters[index]).Value = DBNull.Value; } ! else ! { ! if ( log.IsDebugEnabled ) ! { log.Debug("binding '" + ToXML(value) + "' to parameter: " + index); + } Set(cmd, value, index); *************** *** 179,183 **** /// TODO: determine if this is needed /// </remarks> ! public virtual object NullSafeGet(IDataReader rs, string[] names) { return NullSafeGet(rs, names[0]); } --- 190,195 ---- /// TODO: determine if this is needed /// </remarks> ! public virtual object NullSafeGet(IDataReader rs, string[] names) ! { return NullSafeGet(rs, names[0]); } *************** *** 201,216 **** public virtual object NullSafeGet(IDataReader rs, string name) { - int index = rs.GetOrdinal(name); ! if(rs.IsDBNull(index)) { ! if ( log.IsDebugEnabled ) log.Debug("returning null as column: " + name); // TODO: add a method to NullableType.GetNullValue - if we want to // use "MAGIC" numbers to indicate null values... return null; } ! else { ! object val = null; try --- 213,230 ---- public virtual object NullSafeGet(IDataReader rs, string name) { int index = rs.GetOrdinal(name); ! if( rs.IsDBNull(index) ) ! { ! if ( log.IsDebugEnabled ) ! { log.Debug("returning null as column: " + name); + } // TODO: add a method to NullableType.GetNullValue - if we want to // use "MAGIC" numbers to indicate null values... return null; } ! else ! { object val = null; try *************** *** 225,230 **** } ! if ( log.IsDebugEnabled ) log.Debug("returning '" + ToXML(val) + "' as column: " + name); return val; --- 239,246 ---- } ! if ( log.IsDebugEnabled ) ! { log.Debug("returning '" + ToXML(val) + "' as column: " + name); + } return val; *************** *** 292,296 **** /// a NullableType can only map to one column in a table. /// </remarks> ! public override sealed int GetColumnSpan(IMapping session) { return 1; } --- 308,313 ---- /// a NullableType can only map to one column in a table. /// </remarks> ! public override sealed int GetColumnSpan(IMapping session) ! { return 1; } Index: CharType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/CharType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CharType.cs 21 Aug 2004 16:37:32 -0000 1.4 --- CharType.cs 20 Sep 2004 03:00:29 -0000 1.5 *************** *** 9,13 **** /// Summary description for CharacterType. /// </summary> ! public class CharType : PrimitiveType , IDiscriminatorType { internal CharType() : base( new StringFixedLengthSqlType(1) ) --- 9,13 ---- /// Summary description for CharacterType. /// </summary> ! public class CharType : ValueTypeType , IDiscriminatorType { internal CharType() : base( new StringFixedLengthSqlType(1) ) *************** *** 28,36 **** return Get(rs, rs.GetOrdinal(name)); } ! ! public override System.Type PrimitiveClass { ! get { return typeof(char); } ! } ! public override System.Type ReturnedClass { get { return typeof(char); } --- 28,32 ---- return Get(rs, rs.GetOrdinal(name)); } ! public override System.Type ReturnedClass { get { return typeof(char); } --- PrimitiveType.cs DELETED --- Index: ImmutableType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ImmutableType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ImmutableType.cs 10 Feb 2004 18:41:42 -0000 1.5 --- ImmutableType.cs 20 Sep 2004 03:00:29 -0000 1.6 *************** *** 3,13 **** using NHibernate.SqlTypes; ! namespace NHibernate.Type { ! /// <summary> /// Superclass of nullable immutable types. /// </summary> ! public abstract class ImmutableType : NullableType { ! /// <summary> /// Initialize a new instance of the ImmutableType class using a --- 3,13 ---- using NHibernate.SqlTypes; ! namespace NHibernate.Type ! { /// <summary> /// Superclass of nullable immutable types. /// </summary> ! public abstract class ImmutableType : NullableType ! { /// <summary> /// Initialize a new instance of the ImmutableType class using a *************** *** 25,33 **** /// <returns>A deep copy of the object.</returns> /// <remarks> ! /// This just returns the value passed in because if the object being mapped is ! /// immutable. ! /// ! /// TODO: I really need to understand where this method is used so that the ! /// .NET types inherit from the correct MutableType/ImmutableType IType. /// </remarks> public override sealed object DeepCopyNotNull(object val) --- 25,32 ---- /// <returns>A deep copy of the object.</returns> /// <remarks> ! /// A <see cref="ValueType"/> is considered immutable because a boxed version ! /// of the <see cref="ValueType"/> is being stored by NHibernate. So any changes ! /// made to it would require the <see cref="ValueType"/> to be unboxed and ! /// then reboxed. /// </remarks> public override sealed object DeepCopyNotNull(object val) Index: Int32Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int32Type.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Int32Type.cs 21 Aug 2004 16:37:33 -0000 1.4 --- Int32Type.cs 20 Sep 2004 03:00:29 -0000 1.5 *************** *** 6,10 **** namespace NHibernate.Type { ! public class Int32Type : PrimitiveType, IDiscriminatorType, IVersionType { internal Int32Type() : base( new Int32SqlType() ) --- 6,10 ---- namespace NHibernate.Type { ! public class Int32Type : ValueTypeType, IDiscriminatorType, IVersionType { internal Int32Type() : base( new Int32SqlType() ) *************** *** 20,27 **** } - public override System.Type PrimitiveClass { - get { return typeof(System.Int32); } - } - public override System.Type ReturnedClass { get { return typeof(System.Int32); } --- 20,23 ---- --- NEW FILE: ValueTypeType.cs --- using System; using NHibernate.SqlTypes; using NHibernate.Util; namespace NHibernate.Type { /// <summary> /// Superclass of <see cref="ValueType"/> types. /// </summary> public abstract class ValueTypeType : ImmutableType, ILiteralType { /// <summary> /// Initialize a new instance of the ValueTypeType class using a /// <see cref="SqlType"/>. /// </summary> /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> protected ValueTypeType(SqlType sqlType) : base(sqlType) { } /// <summary> /// Compare two instances of the class mapped by this /// IType for persistence "equality" - ie. Equality of persistent state. /// </summary> /// <param name="x">The left hand side object.</param> /// <param name="y">The right hand side object.</param> /// <returns>True if the two objects contain the same values.</returns> public override bool Equals(object x, object y) { return ObjectUtils.Equals(x, y); } /// <summary> /// A representation of the value to be embedded in an XML element /// </summary> /// <param name="val">The object that contains the values. /// </param> /// <returns>An Xml formatted string.</returns> /// <remarks> /// This just calls <see cref="Object.ToString"/> so if there is /// a possibility of this <see cref="PrimitiveType"/> having any characters /// that need to be encoded then this method should be overridden. /// /// TODO: figure out if this is used to build Xml strings or will have encoding /// done automattically. /// </remarks> public override string ToXML(object val) { return val.ToString(); } /// <summary> /// When implemented by a class, return a <see cref="String"/> representation /// of the value, suitable for embedding in an SQL statement /// </summary> /// <param name="val">The object to convert to a string for the SQL statement.</param> /// <returns>A string that containts a well formed SQL Statement.</returns> public abstract string ObjectToSQLString(object val); } } Index: TicksType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TicksType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TicksType.cs 21 Aug 2004 16:37:33 -0000 1.4 --- TicksType.cs 20 Sep 2004 03:00:29 -0000 1.5 *************** *** 15,19 **** /// is accurate to 100-nanosecond intervals. /// </remarks> ! public class TicksType : MutableType, IVersionType, ILiteralType { internal TicksType() : base( new Int64SqlType() ) --- 15,19 ---- /// is accurate to 100-nanosecond intervals. /// </remarks> ! public class TicksType : ValueTypeType, IVersionType, ILiteralType { internal TicksType() : base( new Int64SqlType() ) *************** *** 52,60 **** } - public override object DeepCopyNotNull(object value) - { - return value; - } - public override bool Equals(object x, object y) { --- 52,55 ---- *************** *** 82,86 **** } ! public string ObjectToSQLString(object value) { return "'" + ((DateTime)value).Ticks.ToString() + "'"; --- 77,81 ---- } ! public override string ObjectToSQLString(object value) { return "'" + ((DateTime)value).Ticks.ToString() + "'"; Index: ObjectType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ObjectType.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ObjectType.cs 21 Aug 2004 16:37:33 -0000 1.7 --- ObjectType.cs 20 Sep 2004 03:00:29 -0000 1.8 *************** *** 142,151 **** } ! public object Assembly(object cached, ISessionImplementor session, object owner) { ObjectTypeCacheEntry e = (ObjectTypeCacheEntry) cached; return (cached==null) ? null : session.Load(e.clazz, e.id); } ! public override object Disassemble(object value, ISessionImplementor session) { return (value==null) ? null : new ObjectTypeCacheEntry( value.GetType(), session.GetEntityIdentifier(value) ); } --- 142,153 ---- } ! public override object Assemble(object cached, ISessionImplementor session, object owner) ! { ObjectTypeCacheEntry e = (ObjectTypeCacheEntry) cached; return (cached==null) ? null : session.Load(e.clazz, e.id); } ! public override object Disassemble(object value, ISessionImplementor session) ! { return (value==null) ? null : new ObjectTypeCacheEntry( value.GetType(), session.GetEntityIdentifier(value) ); } Index: TimestampType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimestampType.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TimestampType.cs 21 Aug 2004 16:37:33 -0000 1.7 --- TimestampType.cs 20 Sep 2004 03:00:29 -0000 1.8 *************** *** 6,10 **** namespace NHibernate.Type { - /// <summary> /// This is almost the exact same type as the DateTime except it can be used --- 6,9 ---- *************** *** 21,33 **** /// <p> /// For example - MsSql Server 2000 is only accurate to 3.33 milliseconds. So if ! /// NHibernate writes a value of '01/01/98 23:59:59.995' to the Prepared Command, MsSql ! /// will store it as '1998-01-01 23:59:59.997'. /// </p> /// <p> /// Please review the documentation of your Database server. /// </p> - /// /// </remarks> ! public class TimestampType : MutableType, IVersionType, ILiteralType { internal TimestampType() : base( new DateTimeSqlType() ) --- 20,31 ---- /// <p> /// For example - MsSql Server 2000 is only accurate to 3.33 milliseconds. So if ! /// NHibernate writes a value of <c>01/01/98 23:59:59.995</c> to the Prepared Command, MsSql ! /// will store it as <c>1998-01-01 23:59:59.997</c>. /// </p> /// <p> /// Please review the documentation of your Database server. /// </p> /// </remarks> ! public class TimestampType : ValueTypeType, IVersionType, ILiteralType { internal TimestampType() : base( new DateTimeSqlType() ) *************** *** 83,91 **** } - public override object DeepCopyNotNull(object value) - { - return value; - } - public override bool Equals(object x, object y) { --- 81,84 ---- *************** *** 113,117 **** } ! public string ObjectToSQLString(object value) { return "'" + value.ToString() + "'"; --- 106,110 ---- } ! public override string ObjectToSQLString(object value) { return "'" + value.ToString() + "'"; Index: DateTimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateTimeType.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DateTimeType.cs 10 Sep 2004 21:27:00 -0000 1.9 --- DateTimeType.cs 20 Sep 2004 03:00:29 -0000 1.10 *************** *** 6,10 **** namespace NHibernate.Type { - /// <summary> /// Maps a System.DateTime Property to a column that stores date & time down to --- 6,9 ---- *************** *** 16,20 **** /// or the <see cref="TicksType"/> /// </remarks> ! public class DateTimeType : MutableType, IIdentifierType, ILiteralType, IVersionType { --- 15,19 ---- /// or the <see cref="TicksType"/> /// </remarks> ! public class DateTimeType : ValueTypeType, IIdentifierType, ILiteralType, IVersionType { *************** *** 84,96 **** } - public override object DeepCopyNotNull(object value) - { - // take advantage of the fact that unboxing with the cast - // and then reboxing with the return as an object will - // return a different box. - return (DateTime)value; - } - - public override bool HasNiceEquals { --- 83,86 ---- *************** *** 103,107 **** } ! public string ObjectToSQLString(object value) { return "'" + value.ToString() + "'"; --- 93,97 ---- } ! public override string ObjectToSQLString(object value) { return "'" + value.ToString() + "'"; Index: PersistentEnumType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentEnumType.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PersistentEnumType.cs 1 Sep 2004 00:16:00 -0000 1.7 --- PersistentEnumType.cs 20 Sep 2004 03:00:29 -0000 1.8 *************** *** 11,15 **** /// PersistentEnumType /// </summary> ! public class PersistentEnumType : ImmutableType, ILiteralType { private readonly System.Type enumClass; --- 11,15 ---- /// PersistentEnumType /// </summary> ! public class PersistentEnumType : ValueTypeType, ILiteralType { private readonly System.Type enumClass; *************** *** 186,190 **** } ! public string ObjectToSQLString(object value) { return GetValue(value).ToString(); --- 186,190 ---- } ! public override string ObjectToSQLString(object value) { return GetValue(value).ToString(); Index: DoubleType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DoubleType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DoubleType.cs 21 Aug 2004 16:37:32 -0000 1.5 --- DoubleType.cs 20 Sep 2004 03:00:29 -0000 1.6 *************** *** 6,10 **** namespace NHibernate.Type { ! public class DoubleType : PrimitiveType { internal DoubleType() : base( new DoubleSqlType() ) --- 6,10 ---- namespace NHibernate.Type { ! public class DoubleType : ValueTypeType { internal DoubleType() : base( new DoubleSqlType() ) *************** *** 20,27 **** } - public override System.Type PrimitiveClass { - get { return typeof(double); } - } - public override System.Type ReturnedClass { get { return typeof(double); } --- 20,23 ---- Index: TimeSpanType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeSpanType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TimeSpanType.cs 21 Aug 2004 16:37:33 -0000 1.4 --- TimeSpanType.cs 20 Sep 2004 03:00:29 -0000 1.5 *************** *** 10,14 **** /// Maps a System.Timespan Property to an Int64 column /// </summary> ! public class TimeSpanType : MutableType, IVersionType, ILiteralType { internal TimeSpanType() : base( new Int64SqlType() ) --- 10,14 ---- /// Maps a System.Timespan Property to an Int64 column /// </summary> ! public class TimeSpanType : ValueTypeType, IVersionType, ILiteralType { internal TimeSpanType() : base( new Int64SqlType() ) *************** *** 47,55 **** } - public override object DeepCopyNotNull(object value) - { - return value; - } - public override bool Equals(object x, object y) { --- 47,50 ---- *************** *** 77,81 **** } ! public string ObjectToSQLString(object value) { return "'" + ((TimeSpan)value).Ticks.ToString() + "'"; --- 72,76 ---- } ! public override string ObjectToSQLString(object value) { return "'" + ((TimeSpan)value).Ticks.ToString() + "'"; |