From: Michael D. <mik...@us...> - 2004-08-03 04:18:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6872/NHibernate/Type Modified Files: TypeFactory.cs Log Message: Added ObjectType to TypeFactory and NHibernate. Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** TypeFactory.cs 31 Jul 2004 19:17:40 -0000 1.35 --- TypeFactory.cs 3 Aug 2004 04:18:44 -0000 1.36 *************** *** 73,82 **** //basicTypes.Add(NHibernate.Currency.Name, NHibernate.Currency); - // don't need an ObjectType in the basicMap because object has - // been depreciated in favor of the <any> element in the mapping. The - // <any> element refers to basic types of custom types. - //basicTypes.Add(typeof(object).Name, NHibernate.Object); - //AddToBasicTypes(NHibernate.Object); - // the Timezone class .NET is not even close to the java.util.Timezone class - in // .NET all you can do is get the local Timezone - there is no "factory" method to --- 73,76 ---- *************** *** 98,101 **** --- 92,96 ---- TypeFactory.GetInt32Type(); TypeFactory.GetInt64Type(); + TypeFactory.GetObjectType(); TypeFactory.GetSerializableType(); TypeFactory.GetSingleType(); *************** *** 243,247 **** } ! private static NullableType AddToTypeOfName(string key, NullableType type) { typeByTypeOfName.Add(key, type); --- 238,242 ---- } ! private static IType AddToTypeOfName(string key, IType type) { typeByTypeOfName.Add(key, type); *************** *** 250,254 **** } ! private static NullableType AddToTypeOfNameWithLength(string key, NullableType type) { typeByTypeOfName.Add(key, type); --- 245,249 ---- } ! private static IType AddToTypeOfNameWithLength(string key, IType type) { typeByTypeOfName.Add(key, type); *************** *** 257,261 **** } ! private static NullableType AddToTypeOfNameWithPrecision(string key, NullableType type) { typeByTypeOfName.Add(key, type); --- 252,256 ---- } ! private static IType AddToTypeOfNameWithPrecision(string key, IType type) { typeByTypeOfName.Add(key, type); *************** *** 701,704 **** --- 696,717 ---- /// </summary> /// <returns></returns> + 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; + } + + /// <summary> + /// + /// </summary> + /// <returns></returns> public static NullableType GetSingleType() { |