From: Michael D. <mik...@us...> - 2004-07-19 03:09:41
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13125/NHibernate/Type Modified Files: TypeFactory.cs Log Message: Minor mods to TypeFactory that are part of a large batch of changes to schema-export and how IDbCommands are built. Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** TypeFactory.cs 3 May 2004 04:56:44 -0000 1.31 --- TypeFactory.cs 19 Jul 2004 03:09:32 -0000 1.32 *************** *** 111,117 **** getTypeDelegatesWithLength.Add(TypeFactory.GetAnsiStringType().Name, new GetNullableTypeWithLength(GetAnsiStringType)); getTypeDelegatesWithLength.Add(TypeFactory.GetBinaryType().Name, new GetNullableTypeWithLength(GetBinaryType)); - getTypeDelegatesWithLength.Add(TypeFactory.GetDoubleType().Name, new GetNullableTypeWithLength(GetDoubleType)); getTypeDelegatesWithLength.Add(TypeFactory.GetSerializableType().Name, new GetNullableTypeWithLength(GetSerializableType)); - getTypeDelegatesWithLength.Add(TypeFactory.GetSingleType().Name, new GetNullableTypeWithLength(GetSingleType)); getTypeDelegatesWithLength.Add(TypeFactory.GetStringType().Name, new GetNullableTypeWithLength(GetStringType)); getTypeDelegatesWithLength.Add(TypeFactory.GetTypeType().Name, new GetNullableTypeWithLength(GetTypeType)); --- 111,115 ---- *************** *** 389,393 **** if(returnType==null) { ! returnType = GetAnsiStringType(255); AddToTypeOfName(key, returnType); } --- 387,391 ---- if(returnType==null) { ! returnType = new AnsiStringType( new AnsiStringSqlType() ); AddToTypeOfName(key, returnType); } *************** *** 403,407 **** if(returnType==null) { ! returnType = new AnsiStringType(SqlTypeFactory.GetAnsiString(length)); AddToTypeOfNameWithLength(key, returnType); } --- 401,405 ---- if(returnType==null) { ! returnType = new AnsiStringType( SqlTypeFactory.GetAnsiString(length) ); AddToTypeOfNameWithLength(key, returnType); } *************** *** 431,436 **** if(returnType==null) { ! returnType = GetBinaryType(255); ! AddToTypeOfName(key, returnType); } --- 429,434 ---- if(returnType==null) { ! returnType = new BinaryType(new BinarySqlType()); ! AddToTypeOfName(key, returnType); } *************** *** 473,477 **** if(returnType==null) { ! returnType = new BooleanType(SqlTypeFactory.GetBoolean()); AddToTypeOfName(key, returnType); } --- 471,475 ---- if(returnType==null) { ! returnType = new BooleanType( SqlTypeFactory.GetBoolean() ); AddToTypeOfName(key, returnType); } *************** *** 491,495 **** if(returnType==null) { ! returnType = new ByteType(SqlTypeFactory.GetByte()); AddToTypeOfName(key, returnType); } --- 489,493 ---- if(returnType==null) { ! returnType = new ByteType( SqlTypeFactory.GetByte() ); AddToTypeOfName(key, returnType); } *************** *** 509,513 **** if(returnType==null) { ! returnType = new CharType(SqlTypeFactory.GetStringFixedLength(1)); AddToTypeOfName(key, returnType); } --- 507,511 ---- if(returnType==null) { ! returnType = new CharType( SqlTypeFactory.GetStringFixedLength(1) ); AddToTypeOfName(key, returnType); } *************** *** 526,532 **** if(returnType==null) { ! //TODO: I believe 10 is still set way to high. If I read the doco correctly ! // then at most it should be 5... ! returnType = new CultureInfoType(SqlTypeFactory.GetString(10)); AddToTypeOfName(key, returnType); } --- 524,528 ---- if(returnType==null) { ! returnType = new CultureInfoType( SqlTypeFactory.GetString(10) ); AddToTypeOfName(key, returnType); } *************** *** 563,567 **** if(returnType==null) { ! returnType = new DateType(SqlTypeFactory.GetDate()); AddToTypeOfName(key, returnType); } --- 559,563 ---- if(returnType==null) { ! returnType = new DateType( SqlTypeFactory.GetDate() ); AddToTypeOfName(key, returnType); } *************** *** 581,585 **** if(returnType==null) { ! returnType = GetDecimalType(19,0); AddToTypeOfName(key, returnType); } --- 577,581 ---- if(returnType==null) { ! returnType = new DecimalType(new DecimalSqlType()); AddToTypeOfName(key, returnType); } *************** *** 601,605 **** if(returnType==null) { ! returnType = new DecimalType(SqlTypeFactory.GetDecimal(precision, scale)); AddToTypeOfNameWithPrecision(key, returnType); } --- 597,601 ---- if(returnType==null) { ! returnType = new DecimalType( SqlTypeFactory.GetDecimal(precision, scale) ); AddToTypeOfNameWithPrecision(key, returnType); } *************** *** 619,623 **** if(returnType==null) { ! returnType = GetDoubleType(53); AddToTypeOfName(key, returnType); } --- 615,619 ---- if(returnType==null) { ! returnType = new DoubleType( SqlTypeFactory.GetDouble() ); AddToTypeOfName(key, returnType); } *************** *** 631,653 **** /// /// </summary> - /// <param name="length"></param> - /// <returns></returns> - public static NullableType GetDoubleType(int length) - { - string key = GetKeyForLengthBased(typeof(DoubleType).FullName, length); - NullableType returnType = (NullableType)typeByTypeOfName[key]; - if(returnType==null) - { - returnType = new DoubleType(SqlTypeFactory.GetDouble(length)); - AddToTypeOfNameWithLength(key, returnType); - } - - return returnType; - - } - - /// <summary> - /// - /// </summary> /// <returns></returns> public static NullableType GetGuidType() --- 627,630 ---- *************** *** 658,662 **** if(returnType==null) { ! returnType = new GuidType(SqlTypeFactory.GetGuid()); AddToTypeOfName(key, returnType); } --- 635,639 ---- if(returnType==null) { ! returnType = new GuidType( SqlTypeFactory.GetGuid() ); AddToTypeOfName(key, returnType); } *************** *** 676,680 **** if(returnType==null) { ! returnType = new Int16Type(SqlTypeFactory.GetInt16()); AddToTypeOfName(key, returnType); } --- 653,657 ---- if(returnType==null) { ! returnType = new Int16Type( SqlTypeFactory.GetInt16() ); AddToTypeOfName(key, returnType); } *************** *** 695,699 **** if(returnType==null) { ! returnType = new Int32Type(SqlTypeFactory.GetInt32()); AddToTypeOfName(key, returnType); } --- 672,676 ---- if(returnType==null) { ! returnType = new Int32Type( SqlTypeFactory.GetInt32() ); AddToTypeOfName(key, returnType); } *************** *** 713,717 **** NullableType returnType = (NullableType)typeByTypeOfName[key]; if(returnType==null) { ! returnType = new Int64Type(SqlTypeFactory.GetInt64()); AddToTypeOfName(key, returnType); } --- 690,694 ---- NullableType returnType = (NullableType)typeByTypeOfName[key]; if(returnType==null) { ! returnType = new Int64Type( SqlTypeFactory.GetInt64() ); AddToTypeOfName(key, returnType); } *************** *** 730,734 **** if(returnType==null) { ! returnType = GetSingleType(24); AddToTypeOfName(key, returnType); } --- 707,711 ---- if(returnType==null) { ! returnType = new SingleType( SqlTypeFactory.GetSingle() ); AddToTypeOfName(key, returnType); } *************** *** 741,764 **** /// /// </summary> - /// <param name="length"></param> - /// <returns></returns> - public static NullableType GetSingleType(int length) - { - string key = GetKeyForLengthBased(typeof(SingleType).FullName, length); - - NullableType returnType = (NullableType)typeByTypeOfName[key]; - if(returnType==null) - { - returnType = new SingleType(SqlTypeFactory.GetSingle(length)); - AddToTypeOfNameWithLength(key, returnType); - } - - return returnType; - - } - - /// <summary> - /// - /// </summary> /// <returns></returns> public static NullableType GetSerializableType() --- 718,721 ---- *************** *** 862,866 **** if(returnType==null) { ! returnType = GetStringType(255); AddToTypeOfName(key, returnType); } --- 819,823 ---- if(returnType==null) { ! returnType = new StringType( new StringSqlType() ); AddToTypeOfName(key, returnType); } *************** *** 881,885 **** if(returnType==null) { ! returnType = new StringType(SqlTypeFactory.GetString(length)); AddToTypeOfNameWithLength(key, returnType); } --- 838,842 ---- if(returnType==null) { ! returnType = new StringType( SqlTypeFactory.GetString(length) ); AddToTypeOfNameWithLength(key, returnType); } *************** *** 901,905 **** if(returnType==null) { ! returnType = new TicksType(SqlTypeFactory.GetInt64()); AddToTypeOfName(key, returnType); } --- 858,862 ---- if(returnType==null) { ! returnType = new TicksType( SqlTypeFactory.GetInt64() ); AddToTypeOfName(key, returnType); } *************** *** 921,925 **** if(returnType==null) { ! returnType = new TimeSpanType(SqlTypeFactory.GetInt64()); AddToTypeOfName(key, returnType); } --- 878,882 ---- if(returnType==null) { ! returnType = new TimeSpanType( SqlTypeFactory.GetInt64() ); AddToTypeOfName(key, returnType); } *************** *** 940,944 **** if(returnType==null) { ! returnType = new TimestampType(SqlTypeFactory.GetDateTime()); AddToTypeOfName(key, returnType); } --- 897,901 ---- if(returnType==null) { ! returnType = new TimestampType( SqlTypeFactory.GetDateTime() ); AddToTypeOfName(key, returnType); } *************** *** 959,963 **** if(returnType==null) { ! returnType = new TimeType(SqlTypeFactory.GetTime()); AddToTypeOfName(key, returnType); } --- 916,920 ---- if(returnType==null) { ! returnType = new TimeType( SqlTypeFactory.GetTime() ); AddToTypeOfName(key, returnType); } *************** *** 978,982 **** if(returnType==null) { ! returnType = new TrueFalseType(SqlTypeFactory.GetAnsiStringFixedLength(1)); AddToTypeOfName(key, returnType); } --- 935,939 ---- if(returnType==null) { ! returnType = new TrueFalseType( SqlTypeFactory.GetAnsiStringFixedLength(1) ); AddToTypeOfName(key, returnType); } *************** *** 999,1003 **** if(returnType==null) { ! returnType = GetTypeType(255); AddToTypeOfName(key, returnType); } --- 956,960 ---- if(returnType==null) { ! returnType = new TypeType( new StringSqlType() ); AddToTypeOfName(key, returnType); } *************** *** 1019,1023 **** if(returnType==null) { ! returnType = new TypeType(SqlTypeFactory.GetString(length)); AddToTypeOfNameWithLength(key, returnType); } --- 976,980 ---- if(returnType==null) { ! returnType = new TypeType( SqlTypeFactory.GetString(length) ); AddToTypeOfNameWithLength(key, returnType); } *************** *** 1038,1042 **** if(returnType==null) { ! returnType = new YesNoType(SqlTypeFactory.GetAnsiStringFixedLength(1)); AddToTypeOfName(key, returnType); } --- 995,999 ---- if(returnType==null) { ! returnType = new YesNoType( SqlTypeFactory.GetAnsiStringFixedLength(1) ); AddToTypeOfName(key, returnType); } |