Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22069/NHibernate/Type Modified Files: AnsiStringType.cs BinaryType.cs BooleanType.cs ByteType.cs CharType.cs CultureInfoType.cs DateTimeType.cs DateType.cs DecimalType.cs DoubleType.cs GuidType.cs Int16Type.cs Int32Type.cs Int64Type.cs ObjectType.cs SerializableType.cs SingleType.cs StringType.cs TicksType.cs TimeSpanType.cs TimestampType.cs TimeType.cs TrueFalseType.cs TypeFactory.cs TypeType.cs YesNoType.cs Log Message: modified Types so that the mapping type="" would be h2.0.3 compatible to allow people to use h2.0.3 existing tools for code generation. Index: TimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TimeType.cs 18 May 2004 05:04:12 -0000 1.4 --- TimeType.cs 21 Aug 2004 16:37:33 -0000 1.5 *************** *** 16,22 **** public class TimeType : MutableType, IIdentifierType, ILiteralType, IVersionType { ! ! ! public TimeType (TimeSqlType sqlType) : base(sqlType) { } --- 16,20 ---- public class TimeType : MutableType, IIdentifierType, ILiteralType, IVersionType { ! internal TimeType() : base( new TimeSqlType() ) { } Index: TypeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TypeType.cs 13 Aug 2004 13:25:23 -0000 1.2 --- TypeType.cs 21 Aug 2004 16:37:33 -0000 1.3 *************** *** 11,15 **** /// variable length string column. /// </summary> ! public class TypeType : ImmutableType { /// <summary> --- 11,20 ---- /// variable length string column. /// </summary> ! public class TypeType : ImmutableType ! { ! ! internal TypeType() : base( new StringSqlType() ) ! { ! } /// <summary> *************** *** 34,45 **** { string str = (string) NHibernate.String.Get(rs, index); ! if (str == null) { return null; } ! else { ! try { return ReflectHelper.ClassForName(str); } ! catch (TypeLoadException) { throw new HibernateException("Class not found: " + str); } --- 39,54 ---- { string str = (string) NHibernate.String.Get(rs, index); ! if (str == null) ! { return null; } ! else ! { ! try ! { return ReflectHelper.ClassForName(str); } ! catch (TypeLoadException) ! { throw new HibernateException("Class not found: " + str); } *************** *** 102,110 **** /// A <see cref="System.Type"/> from the .NET framework. /// </value> ! public override System.Type ReturnedClass { get { return typeof(System.Type); } } ! public override bool Equals(object x, object y) { if(x==null && y==null) --- 111,121 ---- /// A <see cref="System.Type"/> from the .NET framework. /// </value> ! public override System.Type ReturnedClass ! { get { return typeof(System.Type); } } ! public override bool Equals(object x, object y) ! { if(x==null && y==null) *************** *** 121,125 **** } ! public override string Name { get { return "Type"; } } --- 132,137 ---- } ! public override string Name ! { get { return "Type"; } } Index: ByteType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ByteType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ByteType.cs 18 May 2004 05:04:12 -0000 1.5 --- ByteType.cs 21 Aug 2004 16:37:32 -0000 1.6 *************** *** 12,16 **** public class ByteType : PrimitiveType, IDiscriminatorType { ! internal ByteType(ByteSqlType sqlType) : base(sqlType) { } --- 12,17 ---- public class ByteType : PrimitiveType, IDiscriminatorType { ! internal ByteType() : base( new ByteSqlType() ) ! { } Index: DateType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DateType.cs 18 May 2004 05:04:12 -0000 1.8 --- DateType.cs 21 Aug 2004 16:37:32 -0000 1.9 *************** *** 7,14 **** public class DateType : MutableType, IIdentifierType, ILiteralType, IVersionType { ! ! public DateType (DateSqlType sqlType) : base(sqlType) ! { ! } public override object Get(IDataReader rs, int index) --- 7,13 ---- public class DateType : MutableType, IIdentifierType, ILiteralType, IVersionType { ! internal DateType() : base( new DateSqlType() ) ! { ! } public override object Get(IDataReader rs, int index) Index: YesNoType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/YesNoType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** YesNoType.cs 18 Jul 2004 03:06:13 -0000 1.4 --- YesNoType.cs 21 Aug 2004 16:37:33 -0000 1.5 *************** *** 20,24 **** { ! internal YesNoType(AnsiStringFixedLengthSqlType sqlType) : base(sqlType) { } --- 20,24 ---- { ! internal YesNoType() : base( new AnsiStringFixedLengthSqlType(1) ) { } Index: Int16Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int16Type.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Int16Type.cs 18 May 2004 05:04:12 -0000 1.2 --- Int16Type.cs 21 Aug 2004 16:37:33 -0000 1.3 *************** *** 8,12 **** public class Int16Type : PrimitiveType, IDiscriminatorType, IVersionType { ! internal Int16Type(Int16SqlType sqlType) : base(sqlType) { } --- 8,13 ---- public class Int16Type : PrimitiveType, IDiscriminatorType, IVersionType { ! internal Int16Type() : base( new Int16SqlType() ) ! { } Index: CultureInfoType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/CultureInfoType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CultureInfoType.cs 10 Feb 2004 18:41:42 -0000 1.2 --- CultureInfoType.cs 21 Aug 2004 16:37:32 -0000 1.3 *************** *** 13,17 **** public class CultureInfoType : ImmutableType, ILiteralType { ! internal CultureInfoType(StringSqlType sqlType) : base(sqlType) { } --- 13,18 ---- public class CultureInfoType : ImmutableType, ILiteralType { ! internal CultureInfoType() : base( new StringSqlType(5) ) ! { } Index: DecimalType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DecimalType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DecimalType.cs 31 Jul 2004 14:50:32 -0000 1.4 --- DecimalType.cs 21 Aug 2004 16:37:32 -0000 1.5 *************** *** 12,16 **** public class DecimalType : PrimitiveType, IIdentifierType { ! internal DecimalType(DecimalSqlType sqlType) : base(sqlType) { --- 12,19 ---- public class DecimalType : PrimitiveType, IIdentifierType { ! internal DecimalType() : this( new DecimalSqlType() ) ! { ! } ! internal DecimalType(DecimalSqlType sqlType) : base(sqlType) { Index: GuidType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/GuidType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GuidType.cs 18 May 2004 05:04:12 -0000 1.2 --- GuidType.cs 21 Aug 2004 16:37:32 -0000 1.3 *************** *** 10,14 **** { ! internal GuidType(GuidSqlType sqlType) : base(sqlType) { } --- 10,14 ---- { ! internal GuidType() : base( new GuidSqlType() ) { } Index: SingleType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SingleType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SingleType.cs 18 May 2004 05:04:12 -0000 1.3 --- SingleType.cs 21 Aug 2004 16:37:33 -0000 1.4 *************** *** 16,21 **** public class SingleType : PrimitiveType { ! ! internal SingleType(SingleSqlType sqlType) : base(sqlType) { } --- 16,20 ---- public class SingleType : PrimitiveType { ! internal SingleType() : base( new SingleSqlType() ) { } Index: BooleanType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/BooleanType.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** BooleanType.cs 20 Aug 2004 17:39:01 -0000 1.7 --- BooleanType.cs 21 Aug 2004 16:37:32 -0000 1.8 *************** *** 21,30 **** /// <summary> ! /// Initialize a new instance of the BooleanType class using a ! /// <see cref="BooleanSqlType"/>. /// </summary> - /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> /// <remarks>This is used when the Property is mapped to a native boolean type.</remarks> ! internal BooleanType(BooleanSqlType sqlType) : base(sqlType) { } --- 21,29 ---- /// <summary> ! /// Initialize a new instance of the BooleanType /// </summary> /// <remarks>This is used when the Property is mapped to a native boolean type.</remarks> ! internal BooleanType() : base( new BooleanSqlType() ) ! { } Index: Int64Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int64Type.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Int64Type.cs 18 May 2004 05:04:12 -0000 1.2 --- Int64Type.cs 21 Aug 2004 16:37:33 -0000 1.3 *************** *** 8,12 **** public class Int64Type : PrimitiveType, IIdentifierType, IVersionType { ! internal Int64Type(Int64SqlType sqlType) : base(sqlType) { } --- 8,13 ---- public class Int64Type : PrimitiveType, IIdentifierType, IVersionType { ! internal Int64Type() : base( new Int64SqlType() ) ! { } Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** TypeFactory.cs 3 Aug 2004 04:18:44 -0000 1.36 --- TypeFactory.cs 21 Aug 2004 16:37:33 -0000 1.37 *************** *** 4,7 **** --- 4,8 ---- using System.Globalization; + using NHibernate; using NHibernate.Collection; using NHibernate.Engine; *************** *** 43,56 **** * * key -> value * "DateTime" -> instance of DateTimeType ! * "NHibernate.Type.DateTimeType" -> instance of DateTimeType * "Decimal" -> instance of DecimalType with default p,s - * "NHibernate.Type.DecimalType" -> instance of DecimalType with default p,s * "Decimal(p, s)" -> instance of DecimalType with specified p,s - * "NHibernate.Type.DecimalType(p, s)" -> instance of DecimalType with specified p,s * "String" -> instance of StringType with default l * "NHibernate.Type.StringType" -> instance of StringType with default l * "String(l)" -> instance of StringType with specified l ! * "NHibernate.Type.StringType(l)" -> instance of StringType with specified l */ private static Hashtable typeByTypeOfName = Hashtable.Synchronized(new Hashtable(79)); --- 44,58 ---- * * key -> value + * "System.DateTime" -> instance of DateTimeType + * "System.DateTime, fully assembly name" -> instance of DateTimeType * "DateTime" -> instance of DateTimeType ! * "System.Decimal" -> instance of DecimaType with default p,s * "Decimal" -> instance of DecimalType with default p,s * "Decimal(p, s)" -> instance of DecimalType with specified p,s * "String" -> instance of StringType with default l + * "System.String" -> instance of StringType with default l * "NHibernate.Type.StringType" -> instance of StringType with default l * "String(l)" -> instance of StringType with specified l ! * "System.String(l)" -> instance of StringType with specified l */ private static Hashtable typeByTypeOfName = Hashtable.Synchronized(new Hashtable(79)); *************** *** 66,71 **** static TypeFactory() { - - //basicTypes.Add(NHibernate.Blob.Name, NHibernate.Blob); //basicTypes.Add(NHibernate.Clob.Name, NHibernate.Clob); --- 68,71 ---- *************** *** 77,114 **** // get a Timezone by name... //basicTypes.Add(NHibernate.Timezone.Name, NHibernate.Timezone); ! TypeFactory.GetAnsiStringType(); ! TypeFactory.GetBinaryType(); ! TypeFactory.GetBooleanType(); ! TypeFactory.GetByteType(); ! TypeFactory.GetCharType(); ! TypeFactory.GetCultureInfoType(); ! TypeFactory.GetDateTimeType(); ! TypeFactory.GetDateType(); ! TypeFactory.GetDecimalType(); ! TypeFactory.GetDoubleType(); ! TypeFactory.GetGuidType(); ! TypeFactory.GetInt16Type(); ! TypeFactory.GetInt32Type(); ! TypeFactory.GetInt64Type(); ! TypeFactory.GetObjectType(); ! TypeFactory.GetSerializableType(); ! TypeFactory.GetSingleType(); ! TypeFactory.GetStringType(); ! TypeFactory.GetTimestampType(); ! TypeFactory.GetTimeType(); ! TypeFactory.GetTrueFalseType(); ! TypeFactory.GetTypeType(); ! TypeFactory.GetYesNoType(); ! TypeFactory.GetTicksType(); ! TypeFactory.GetTimeSpanType(); ! getTypeDelegatesWithLength.Add(TypeFactory.GetAnsiStringType().Name, new GetNullableTypeWithLength(GetAnsiStringType)); ! getTypeDelegatesWithLength.Add(TypeFactory.GetBinaryType().Name, new GetNullableTypeWithLength(GetBinaryType)); ! getTypeDelegatesWithLength.Add(TypeFactory.GetSerializableType().Name, new GetNullableTypeWithLength(GetSerializableType)); ! getTypeDelegatesWithLength.Add(TypeFactory.GetStringType().Name, new GetNullableTypeWithLength(GetStringType)); ! getTypeDelegatesWithLength.Add(TypeFactory.GetTypeType().Name, new GetNullableTypeWithLength(GetTypeType)); ! getTypeDelegatesWithPrecision.Add(TypeFactory.GetDecimalType().Name, new GetNullableTypeWithPrecision(GetDecimalType)); } --- 77,179 ---- // get a Timezone by name... //basicTypes.Add(NHibernate.Timezone.Name, NHibernate.Timezone); + typeByTypeOfName[ typeof(System.Byte[]).Name ] = NHibernate.Binary ; + typeByTypeOfName[ typeof(System.Byte[]).AssemblyQualifiedName ] = NHibernate.Binary ; + typeByTypeOfName[ typeof(System.Boolean).FullName ] = NHibernate.Boolean; + typeByTypeOfName[ typeof(System.Boolean).AssemblyQualifiedName ] = NHibernate.Boolean; + typeByTypeOfName[ typeof(System.Byte).FullName ] = NHibernate.Byte; + typeByTypeOfName[ typeof(System.Byte).AssemblyQualifiedName ] = NHibernate.Byte; + typeByTypeOfName[ typeof(System.Char).FullName ] = NHibernate.Character; + typeByTypeOfName[ typeof(System.Char).AssemblyQualifiedName ] = NHibernate.Character; + typeByTypeOfName[ typeof(System.Globalization.CultureInfo).FullName ] = NHibernate.CultureInfo; + typeByTypeOfName[ typeof(System.Globalization.CultureInfo).AssemblyQualifiedName ] = NHibernate.CultureInfo; + typeByTypeOfName[ typeof(System.DateTime).FullName ] = NHibernate.DateTime; + typeByTypeOfName[ typeof(System.DateTime).AssemblyQualifiedName ] = NHibernate.DateTime; + typeByTypeOfName[ typeof(System.Decimal).FullName ] = NHibernate.Decimal; + typeByTypeOfName[ typeof(System.Decimal).AssemblyQualifiedName ] = NHibernate.Decimal; + typeByTypeOfName[ typeof(System.Double).FullName ] = NHibernate.Double; + typeByTypeOfName[ typeof(System.Double).AssemblyQualifiedName ] = NHibernate.Double; + typeByTypeOfName[ typeof(System.Guid).FullName ] = NHibernate.Guid; + typeByTypeOfName[ typeof(System.Guid).AssemblyQualifiedName ] = NHibernate.Guid; + typeByTypeOfName[ typeof(System.Int16).FullName ] = NHibernate.Int16; + typeByTypeOfName[ typeof(System.Int16).AssemblyQualifiedName ] = NHibernate.Int16; + typeByTypeOfName[ typeof(System.Int32).FullName ] = NHibernate.Int32; + typeByTypeOfName[ typeof(System.Int32).AssemblyQualifiedName ] = NHibernate.Int32; + typeByTypeOfName[ typeof(System.Int64).FullName ] = NHibernate.Int64; + typeByTypeOfName[ typeof(System.Int64).AssemblyQualifiedName ] = NHibernate.Int64; + typeByTypeOfName[ typeof(System.Single).FullName ] = NHibernate.Single; + typeByTypeOfName[ typeof(System.Single).AssemblyQualifiedName ] = NHibernate.Single; + typeByTypeOfName[ typeof(System.String).FullName ] = NHibernate.String; + typeByTypeOfName[ typeof(System.String).AssemblyQualifiedName ] = NHibernate.String; + typeByTypeOfName[ typeof(System.TimeSpan).FullName ] = NHibernate.TimeSpan; + typeByTypeOfName[ typeof(System.TimeSpan).AssemblyQualifiedName ] = NHibernate.TimeSpan; ! typeByTypeOfName[ NHibernate.AnsiString.Name ] = NHibernate.AnsiString ; ! typeByTypeOfName[ NHibernate.Binary.Name ] = NHibernate.Binary ; ! typeByTypeOfName[ NHibernate.Boolean.Name ] = NHibernate.Boolean; ! typeByTypeOfName[ NHibernate.Byte.Name ] = NHibernate.Byte; ! typeByTypeOfName[ NHibernate.Character.Name ] = NHibernate.Character; ! typeByTypeOfName[ NHibernate.CultureInfo.Name ] = NHibernate.CultureInfo; ! typeByTypeOfName[ NHibernate.DateTime.Name ] = NHibernate.DateTime; ! typeByTypeOfName[ NHibernate.Date.Name ] = NHibernate.Date; ! typeByTypeOfName[ NHibernate.Decimal.Name ] = NHibernate.Decimal; ! typeByTypeOfName[ NHibernate.Double.Name ] = NHibernate.Double; ! typeByTypeOfName[ NHibernate.Guid.Name ] = NHibernate.Guid; ! typeByTypeOfName[ NHibernate.Int16.Name ] = NHibernate.Int16; ! typeByTypeOfName[ NHibernate.Int32.Name ] = NHibernate.Int32; ! typeByTypeOfName[ NHibernate.Int64.Name ] = NHibernate.Int64; ! typeByTypeOfName[ NHibernate.String.Name ] = NHibernate.String; ! typeByTypeOfName[ NHibernate.Single.Name ] = NHibernate.Single; ! typeByTypeOfName[ NHibernate.Timestamp.Name ] = NHibernate.Timestamp; ! typeByTypeOfName[ NHibernate.Time.Name ] = NHibernate.Time; ! typeByTypeOfName[ NHibernate.TrueFalse.Name ] = NHibernate.TrueFalse; ! typeByTypeOfName[ NHibernate.YesNo.Name ] = NHibernate.YesNo; ! typeByTypeOfName[ NHibernate.Ticks.Name ] = NHibernate.Ticks; ! typeByTypeOfName[ NHibernate.TimeSpan.Name ] = NHibernate.TimeSpan; ! ! typeByTypeOfName[ NHibernate.Class.Name ] = NHibernate.Class; ! typeByTypeOfName[ typeof(System.Type).FullName ] = NHibernate.Class; ! typeByTypeOfName[ typeof(System.Type).AssemblyQualifiedName ] = NHibernate.Class; ! // need to do add the key "Serializable" because the hbm files will have a ! // type="Serializable", but the SerializableType returns the Name as ! // "serializable - System.Object for the default SerializableType. ! typeByTypeOfName[ "Serializable" ] = NHibernate.Serializable; ! typeByTypeOfName[ NHibernate.Serializable.Name ] = NHibernate.Serializable; ! ! typeByTypeOfName[ typeof(System.Object).FullName ] = NHibernate.Object; ! typeByTypeOfName[ typeof(System.Object).AssemblyQualifiedName ] = NHibernate.Object; ! typeByTypeOfName[ NHibernate.Object.Name ] = NHibernate.Object; ! ! // These are in here for Hibernate mapping compatibility ! typeByTypeOfName[ "binary" ] = NHibernate.Binary ; ! // TODO: add clob and blob when implemented ! typeByTypeOfName[ "boolean" ] = NHibernate.Boolean; ! typeByTypeOfName[ "byte" ] = NHibernate.Byte; ! typeByTypeOfName[ "character" ] = NHibernate.Character; ! typeByTypeOfName[ "class" ] = NHibernate.Class; ! typeByTypeOfName[ "locale" ] = NHibernate.CultureInfo; ! typeByTypeOfName[ "date" ] = NHibernate.DateTime; ! typeByTypeOfName[ "big_decimal" ] = NHibernate.Decimal; ! typeByTypeOfName[ "double" ] = NHibernate.Double; ! typeByTypeOfName[ "short" ] = NHibernate.Int16; ! typeByTypeOfName[ "integer" ] = NHibernate.Int32; ! typeByTypeOfName[ "long" ] = NHibernate.Int64; ! typeByTypeOfName[ "float" ] = NHibernate.Single; ! typeByTypeOfName[ "serializable" ] = NHibernate.Serializable; ! typeByTypeOfName[ "string" ] = NHibernate.String; ! typeByTypeOfName[ "timestamp" ] = NHibernate.Timestamp; ! typeByTypeOfName[ "time" ] = NHibernate.Time; ! typeByTypeOfName[ "true_false" ] = NHibernate.TrueFalse; ! typeByTypeOfName[ "yes_no" ] = NHibernate.YesNo; ! typeByTypeOfName[ "object" ] = NHibernate.Object; ! ! getTypeDelegatesWithLength.Add(NHibernate.AnsiString.Name, new GetNullableTypeWithLength(GetAnsiStringType)); ! getTypeDelegatesWithLength.Add(NHibernate.Binary.Name, new GetNullableTypeWithLength(GetBinaryType)); ! getTypeDelegatesWithLength.Add(NHibernate.Serializable.Name, new GetNullableTypeWithLength(GetSerializableType)); ! getTypeDelegatesWithLength.Add(NHibernate.String.Name, new GetNullableTypeWithLength(GetStringType)); ! getTypeDelegatesWithLength.Add(NHibernate.Class.Name, new GetNullableTypeWithLength(GetTypeType)); ! ! getTypeDelegatesWithPrecision.Add(NHibernate.Decimal.Name, new GetNullableTypeWithPrecision(GetDecimalType)); } *************** *** 248,252 **** { typeByTypeOfName.Add(key, type); - typeByTypeOfName.Add(GetKeyForLengthBased(type), type); return type; } --- 313,316 ---- *************** *** 255,259 **** { typeByTypeOfName.Add(key, type); - typeByTypeOfName.Add(GetKeyForPrecisionScaleBased(type), type); return type; } --- 319,322 ---- *************** *** 377,395 **** public static NullableType GetAnsiStringType() { ! string key = typeof(AnsiStringType).FullName; ! ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new AnsiStringType( new AnsiStringSqlType() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; } public static NullableType GetAnsiStringType(int length) { ! string key = GetKeyForLengthBased(typeof(AnsiStringType).FullName, length); NullableType returnType = (NullableType)typeByTypeOfName[key]; --- 440,449 ---- public static NullableType GetAnsiStringType() { ! return NHibernate.AnsiString; } public static NullableType GetAnsiStringType(int length) { ! string key = GetKeyForLengthBased(NHibernate.AnsiString.Name, length); NullableType returnType = (NullableType)typeByTypeOfName[key]; *************** *** 420,433 **** public static NullableType GetBinaryType() { ! string key = typeof(BinaryType).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new BinaryType(new BinarySqlType()); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 474,478 ---- public static NullableType GetBinaryType() { ! return NHibernate.Binary; } *************** *** 444,448 **** public static NullableType GetBinaryType(int length) { ! string key = GetKeyForLengthBased(typeof(BinaryType).FullName, length); NullableType returnType = (NullableType)typeByTypeOfName[key]; if(returnType==null) --- 489,496 ---- public static NullableType GetBinaryType(int length) { ! //HACK: don't understand why SerializableType calls this with length=0 ! if(length==0) return NHibernate.Binary; ! ! string key = GetKeyForLengthBased(NHibernate.Binary.Name, length); NullableType returnType = (NullableType)typeByTypeOfName[key]; if(returnType==null) *************** *** 462,475 **** public static NullableType GetBooleanType() { ! string key = typeof(BooleanType).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new BooleanType( SqlTypeFactory.GetBoolean() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 510,514 ---- public static NullableType GetBooleanType() { ! return NHibernate.Boolean; } *************** *** 480,493 **** public static NullableType GetByteType() { ! string key = typeof(ByteType).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new ByteType( SqlTypeFactory.GetByte() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 519,523 ---- public static NullableType GetByteType() { ! return NHibernate.Byte; } *************** *** 498,510 **** public static NullableType GetCharType() { ! string key = GetKeyForLengthBased(typeof(CharType).FullName, 1); ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new CharType( SqlTypeFactory.GetStringFixedLength(1) ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; } --- 528,532 ---- public static NullableType GetCharType() { ! return NHibernate.Character; } *************** *** 515,528 **** public static NullableType GetCultureInfoType() { ! string key = typeof(CultureInfoType).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new CultureInfoType( SqlTypeFactory.GetString(5) ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 537,541 ---- public static NullableType GetCultureInfoType() { ! return NHibernate.CultureInfo; } *************** *** 533,545 **** public static NullableType GetDateTimeType() { ! string key = typeof(DateTimeType).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new DateTimeType(SqlTypeFactory.GetDateTime()); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; } --- 546,550 ---- public static NullableType GetDateTimeType() { ! return NHibernate.DateTime; } *************** *** 550,562 **** public static NullableType GetDateType() { ! string key = typeof(DateType).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new DateType( SqlTypeFactory.GetDate() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; } --- 555,559 ---- public static NullableType GetDateType() { ! return NHibernate.Date; } *************** *** 568,581 **** public static NullableType GetDecimalType() { ! string key = typeof(DecimalType).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new DecimalType(new DecimalSqlType()); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 565,569 ---- public static NullableType GetDecimalType() { ! return NHibernate.Decimal; } *************** *** 588,592 **** public static NullableType GetDecimalType(byte precision, byte scale) { ! string key = GetKeyForPrecisionScaleBased(typeof(DecimalType).FullName, precision, scale); NullableType returnType = (NullableType)typeByTypeOfName[key]; if(returnType==null) --- 576,580 ---- public static NullableType GetDecimalType(byte precision, byte scale) { ! string key = GetKeyForPrecisionScaleBased(NHibernate.Decimal.Name, precision, scale); NullableType returnType = (NullableType)typeByTypeOfName[key]; if(returnType==null) *************** *** 606,620 **** public static NullableType GetDoubleType() { ! string key = typeof(DoubleType).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new DoubleType( SqlTypeFactory.GetDouble() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! ! } --- 594,598 ---- public static NullableType GetDoubleType() { ! return NHibernate.Double; } *************** *** 625,639 **** public static NullableType GetGuidType() { ! ! string key = typeof(GuidType).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new GuidType( SqlTypeFactory.GetGuid() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 603,607 ---- public static NullableType GetGuidType() { ! return NHibernate.Guid; } *************** *** 644,657 **** public static NullableType GetInt16Type() { ! string key = typeof(Int16Type).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new Int16Type( SqlTypeFactory.GetInt16() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 612,616 ---- public static NullableType GetInt16Type() { ! return NHibernate.Int16; } *************** *** 662,676 **** public static NullableType GetInt32Type() { ! ! string key = typeof(Int32Type).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new Int32Type( SqlTypeFactory.GetInt32() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 621,625 ---- public static NullableType GetInt32Type() { ! return NHibernate.Int32; } *************** *** 681,693 **** public static NullableType GetInt64Type() { ! string key = typeof(Int64Type).FullName; ! ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) { ! returnType = new Int64Type( SqlTypeFactory.GetInt64() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; } --- 630,634 ---- public static NullableType GetInt64Type() { ! return NHibernate.Int64; } *************** *** 698,711 **** public static IType GetObjectType() { ! string key = typeof(ObjectType).FullName; ! ! IType returnType = (IType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new ObjectType( ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; } --- 639,643 ---- public static IType GetObjectType() { ! return NHibernate.Object; } *************** *** 716,729 **** public static NullableType GetSingleType() { ! string key = typeof(SingleType).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new SingleType( SqlTypeFactory.GetSingle() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 648,652 ---- public static NullableType GetSingleType() { ! return NHibernate.Single; } *************** *** 734,746 **** public static NullableType GetSerializableType() { ! string key = typeof(SerializableType).FullName; ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new SerializableType( typeof(object) ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; } --- 657,661 ---- public static NullableType GetSerializableType() { ! return NHibernate.Serializable; } *************** *** 808,812 **** public static NullableType GetSerializableType(int length) { ! string key = GetKeyForLengthBased(typeof(SerializableType).FullName, length); NullableType returnType = (NullableType)typeByTypeOfName[key]; --- 723,727 ---- public static NullableType GetSerializableType(int length) { ! string key = GetKeyForLengthBased(NHibernate.Serializable.Name, length); NullableType returnType = (NullableType)typeByTypeOfName[key]; *************** *** 827,840 **** public static NullableType GetStringType() { ! string key = typeof(StringType).FullName; ! ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new StringType( new StringSqlType() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; } --- 742,746 ---- public static NullableType GetStringType() { ! return NHibernate.String; } *************** *** 846,850 **** public static NullableType GetStringType(int length) { ! string key = GetKeyForLengthBased(typeof(StringType).FullName, length); NullableType returnType = (NullableType)typeByTypeOfName[key]; --- 752,756 ---- public static NullableType GetStringType(int length) { ! string key = GetKeyForLengthBased(NHibernate.String.Name, length); NullableType returnType = (NullableType)typeByTypeOfName[key]; *************** *** 865,880 **** public static NullableType GetTicksType() { ! ! string key = typeof(TicksType).FullName; ! ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new TicksType( SqlTypeFactory.GetInt64() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 771,775 ---- public static NullableType GetTicksType() { ! return NHibernate.Ticks; } *************** *** 885,900 **** public static NullableType GetTimeSpanType() { ! ! string key = typeof(TimeSpanType).FullName; ! ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new TimeSpanType( SqlTypeFactory.GetInt64() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 780,784 ---- public static NullableType GetTimeSpanType() { ! return NHibernate.TimeSpan; } *************** *** 904,919 **** /// <returns></returns> public static NullableType GetTimestampType() ! { ! string key = typeof(TimestampType).FullName; ! ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new TimestampType( SqlTypeFactory.GetDateTime() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 788,793 ---- /// <returns></returns> public static NullableType GetTimestampType() ! { ! return NHibernate.Timestamp; } *************** *** 924,938 **** public static NullableType GetTimeType() { ! string key = typeof(TimeType).FullName; ! ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new TimeType( SqlTypeFactory.GetTime() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 798,802 ---- public static NullableType GetTimeType() { ! return NHibernate.Time; } *************** *** 943,957 **** public static NullableType GetTrueFalseType() { ! string key = typeof(TrueFalseType).FullName; ! ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new TrueFalseType( SqlTypeFactory.GetAnsiStringFixedLength(1) ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 807,811 ---- public static NullableType GetTrueFalseType() { ! return NHibernate.TrueFalse; } *************** *** 962,978 **** public static NullableType GetTypeType() { ! // this will add the default basic name ! // for the TypeType it will add this TypeType as Type and Type(255) ! string key = typeof(TypeType).FullName; ! ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new TypeType( new StringSqlType() ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 816,820 ---- public static NullableType GetTypeType() { ! return NHibernate.Class; } *************** *** 1003,1017 **** public static NullableType GetYesNoType() { ! string key = typeof(YesNoType).FullName; ! ! NullableType returnType = (NullableType)typeByTypeOfName[key]; ! if(returnType==null) ! { ! returnType = new YesNoType( SqlTypeFactory.GetAnsiStringFixedLength(1) ); ! AddToTypeOfName(key, returnType); ! } ! ! return returnType; ! } --- 845,849 ---- public static NullableType GetYesNoType() { ! return NHibernate.YesNo; } Index: CharType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/CharType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CharType.cs 20 Aug 2004 17:39:01 -0000 1.3 --- CharType.cs 21 Aug 2004 16:37:32 -0000 1.4 *************** *** 11,15 **** public class CharType : PrimitiveType , IDiscriminatorType { ! internal CharType(StringFixedLengthSqlType sqlType) : base(sqlType) { } --- 11,16 ---- public class CharType : PrimitiveType , IDiscriminatorType { ! internal CharType() : base( new StringFixedLengthSqlType(1) ) ! { } Index: BinaryType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/BinaryType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BinaryType.cs 20 Aug 2004 17:39:01 -0000 1.5 --- BinaryType.cs 21 Aug 2004 16:37:32 -0000 1.6 *************** *** 12,17 **** /// BinaryType. /// </summary> ! public class BinaryType : MutableType{ ! internal BinaryType(BinarySqlType sqlType) : base(sqlType) { } --- 12,21 ---- /// BinaryType. /// </summary> ! public class BinaryType : MutableType ! { ! internal BinaryType() : this( new BinarySqlType() ) ! { ! } ! internal BinaryType(BinarySqlType sqlType) : base(sqlType) { } Index: SerializableType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SerializableType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SerializableType.cs 31 Jul 2004 19:16:44 -0000 1.4 --- SerializableType.cs 21 Aug 2004 16:37:33 -0000 1.5 *************** *** 30,37 **** private BinaryType binaryType; ! public SerializableType(System.Type serializableClass) ! //: this(serializableClass, SqlTypeFactory.GetBinary()) ! : this( serializableClass, new BinarySqlType() ) { } --- 30,41 ---- private BinaryType binaryType; ! internal SerializableType() : this( typeof(Object) ) ! { ! } ! ! internal SerializableType(System.Type serializableClass) : base( new BinarySqlType() ) { + this.serializableClass = serializableClass; + this.binaryType = (BinaryType)NHibernate.Binary; } *************** *** 71,75 **** } public override string Name { ! get { return serializableClass.FullName; } } public override object DeepCopyNotNull(object value) { --- 75,79 ---- } public override string Name { ! get { return "serializable - " + serializableClass.FullName; } } public override object DeepCopyNotNull(object value) { Index: Int32Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int32Type.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Int32Type.cs 18 May 2004 05:04:12 -0000 1.3 --- Int32Type.cs 21 Aug 2004 16:37:33 -0000 1.4 *************** *** 8,12 **** public class Int32Type : PrimitiveType, IDiscriminatorType, IVersionType { ! internal Int32Type(Int32SqlType sqlType) : base(sqlType) { } --- 8,13 ---- public class Int32Type : PrimitiveType, IDiscriminatorType, IVersionType { ! internal Int32Type() : base( new Int32SqlType() ) ! { } Index: TicksType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TicksType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TicksType.cs 18 May 2004 05:04:12 -0000 1.3 --- TicksType.cs 21 Aug 2004 16:37:33 -0000 1.4 *************** *** 17,22 **** public class TicksType : MutableType, IVersionType, ILiteralType { ! ! public TicksType(Int64SqlType sqlType) : base(sqlType) { } --- 17,21 ---- public class TicksType : MutableType, IVersionType, ILiteralType { ! internal TicksType() : base( new Int64SqlType() ) { } Index: ObjectType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ObjectType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ObjectType.cs 9 Aug 2004 03:09:25 -0000 1.6 --- ObjectType.cs 21 Aug 2004 16:37:33 -0000 1.7 *************** *** 43,53 **** private readonly IType metaType; ! public ObjectType(IType metaType, IType identifierType) { this.identifierType = identifierType; this.metaType = metaType; } ! public ObjectType() : this(TypeFactory.GetTypeType(), TypeFactory.GetSerializableType()) { ! //NHibernate.Class, NHibernate.Serializable) { } --- 43,53 ---- private readonly IType metaType; ! internal ObjectType(IType metaType, IType identifierType) { this.identifierType = identifierType; this.metaType = metaType; } ! internal ObjectType() : this(NHibernate.Class, NHibernate.Serializable) ! { } Index: AnsiStringType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/AnsiStringType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AnsiStringType.cs 18 May 2004 05:04:12 -0000 1.2 --- AnsiStringType.cs 21 Aug 2004 16:37:32 -0000 1.3 *************** *** 12,15 **** --- 12,18 ---- public class AnsiStringType : ImmutableType, IDiscriminatorType { + internal AnsiStringType() : base( new AnsiStringSqlType() ) + { + } internal AnsiStringType(AnsiStringSqlType sqlType) : base(sqlType) {} Index: TimestampType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimestampType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TimestampType.cs 29 Jul 2004 13:04:24 -0000 1.6 --- TimestampType.cs 21 Aug 2004 16:37:33 -0000 1.7 *************** *** 31,36 **** public class TimestampType : MutableType, IVersionType, ILiteralType { ! ! public TimestampType(DateTimeSqlType sqlType) : base(sqlType) { } --- 31,35 ---- public class TimestampType : MutableType, IVersionType, ILiteralType { ! internal TimestampType() : base( new DateTimeSqlType() ) { } Index: DateTimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateTimeType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DateTimeType.cs 18 May 2004 05:04:12 -0000 1.6 --- DateTimeType.cs 21 Aug 2004 16:37:32 -0000 1.7 *************** *** 19,23 **** { ! public DateTimeType(DateTimeSqlType sqlType) : base(sqlType) { } --- 19,23 ---- { ! internal DateTimeType() : base( new DateTimeSqlType() ) { } Index: StringType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/StringType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StringType.cs 18 May 2004 05:04:12 -0000 1.4 --- StringType.cs 21 Aug 2004 16:37:33 -0000 1.5 *************** *** 13,16 **** --- 13,20 ---- public class StringType : ImmutableType, IDiscriminatorType { + internal StringType() : base( new StringSqlType() ) + { + } + internal StringType(StringSqlType sqlType) : base(sqlType) { } Index: DoubleType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DoubleType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DoubleType.cs 18 May 2004 05:04:12 -0000 1.4 --- DoubleType.cs 21 Aug 2004 16:37:32 -0000 1.5 *************** *** 8,12 **** public class DoubleType : PrimitiveType { ! internal DoubleType(DoubleSqlType sqlType) : base(sqlType) { } --- 8,13 ---- public class DoubleType : PrimitiveType { ! internal DoubleType() : base( new DoubleSqlType() ) ! { } Index: TimeSpanType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeSpanType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TimeSpanType.cs 18 May 2004 05:04:12 -0000 1.3 --- TimeSpanType.cs 21 Aug 2004 16:37:33 -0000 1.4 *************** *** 12,17 **** public class TimeSpanType : MutableType, IVersionType, ILiteralType { ! ! public TimeSpanType(Int64SqlType sqlType) : base(sqlType) { } --- 12,16 ---- public class TimeSpanType : MutableType, IVersionType, ILiteralType { ! internal TimeSpanType() : base( new Int64SqlType() ) { } Index: TrueFalseType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TrueFalseType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TrueFalseType.cs 18 Jul 2004 03:06:13 -0000 1.3 --- TrueFalseType.cs 21 Aug 2004 16:37:33 -0000 1.4 *************** *** 19,24 **** public class TrueFalseType: CharBooleanType { ! ! internal TrueFalseType(AnsiStringFixedLengthSqlType sqlType) : base(sqlType) { } --- 19,24 ---- public class TrueFalseType: CharBooleanType { ! internal TrueFalseType() : base( new AnsiStringFixedLengthSqlType(1) ) ! { } |